public abstract class InteractiveObject extends GameObject implements Clickable, com.badlogic.gdx.utils.Pool.Poolable
Modifier and Type | Class and Description |
---|---|
static class |
InteractiveObject.InteractiveState |
Constructor and Description |
---|
InteractiveObject(float x,
float y,
float width,
float height)
Creates the Interactive GameObject with the given bottom-center position and the given collider width and height.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canTarget()
Returns true if the Interactive GameObject can be targetted by the player.
|
InteractiveObject.InteractiveState |
getInteractiveState()
Gets the current state of the interactive object for logic and rendering purposes.
|
java.util.HashMap<java.lang.Class,java.lang.Float> |
getItemProbabilityMap()
Returns the HashMap which holds which items will be dropped when this InteractiveObject is scavenged.
|
void |
reset()
Called whenever this GameObject has been pushed back into a pool.
|
abstract void |
scavenged()
Called when the Interactive GameObject has been scavenged and can no longer be targetted.
|
void |
setInteractiveState(InteractiveObject.InteractiveState interactiveState)
Sets the current state of the interactive object for logic and rendering purposes.
|
void |
setItemProbabilityMap(java.util.HashMap<java.lang.Class,java.lang.Float> itemProbabilityMap)
Sets the HashMap which holds which items will be dropped when this InteractiveObject is scavenged.
|
void |
targetted()
Called when the Interactive GameObject has just been targetted by a Human
|
void |
untargetted()
Called when the Interactive GameObject has just been untargetted by a Human
|
abstract void |
update(float deltaTime)
Called every frame to update logic.
|
getAcceleration, getCollider, getObjectId, getPosition, getPreviousPosition, getSkeleton, getStateTime, getTerrainCell, getVelocity, getX, getY, isAbove, moveTo, setAcceleration, setCollider, setObjectId, setPosition, setSkeleton, setStateTime, setTerrainCell, setVelocity, setVelocityX, setVelocityY, setX, setY, updateCollider, updatePosition
public InteractiveObject(float x, float y, float width, float height)
public void targetted()
public void untargetted()
public boolean canTarget()
canTarget
in class GameObject
public InteractiveObject.InteractiveState getInteractiveState()
public void setInteractiveState(InteractiveObject.InteractiveState interactiveState)
public java.util.HashMap<java.lang.Class,java.lang.Float> getItemProbabilityMap()
public void setItemProbabilityMap(java.util.HashMap<java.lang.Class,java.lang.Float> itemProbabilityMap)
public void reset()
reset
in interface com.badlogic.gdx.utils.Pool.Poolable
public abstract void update(float deltaTime)
update
in class GameObject
public abstract void scavenged()