public class RotatingEntity extends OdorWorldEntity
Constructor and Description |
---|
RotatingEntity(OdorWorld world)
Create a rotating entity using default map.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getEntityType() |
double |
getHeading()
Returns the current heading, in degrees.
|
double |
getHeadingRadians()
Returns the heading in radians.
|
java.util.TreeMap<java.lang.Double,Animation> |
getImageMap() |
ComboBoxWrapper |
getType()
Getter which returns data that can be used in a combo box (the property
editor dialog).
|
void |
goStraight(double amount)
Move the entity in a straight line relative to its current heading.
|
void |
postSerializationInit()
Initialize map animations using image location information.
|
void |
setEntityType(java.lang.String type) |
void |
setHeading(double d)
Set the orientation of the creature.
|
void |
setImageMap(java.util.TreeMap<java.lang.Double,Animation> imageMap) |
void |
setType(ComboBoxWrapper imageData)
Setter which takes the data from a combo box as an argument.
|
void |
turn(double amount)
Turn by the specified amount, positive or negative.
|
void |
turnLeft(double amount)
Rotate left by the specified amount.
|
void |
turnRight(double amount)
Rotate right by the specified amount.
|
void |
update()
Updates this OdorWorldEntity's Animation and its position based on the
velocity.
|
addEffector, addSensor, addTileSensors, addTileSensors, applyEffectors, collideHorizontal, collideVertical, getAnimation, getBehavior, getBounds, getCenterLocation, getCenterX, getCenterY, getCurrentlyHeardPhrases, getDoubleX, getDoubleY, getEffectors, getHeight, getId, getImage, getLocation, getName, getParentWorld, getReducedBounds, getSensors, getSmellSource, getVelocityX, getVelocityY, getWidth, getX, getY, hasCollided, isBlocked, isEffectorsEnabled, isInBoundsX, isInBoundsY, isSensorsEnabled, isShowSensors, moveEast, moveNorth, moveSouth, moveWest, removeEffector, removeSensor, setAnimation, setCenterLocation, setEffectors, setEffectorsEnabled, setHasCollided, setId, setLocation, setName, setSensors, setSensorsEnabled, setShowSensors, setSmellSource, setVelocityX, setVelocityY, setX, setX, setY, setY, speakToEntity, updateSensors, updateSmellSource
public RotatingEntity(OdorWorld world)
world
- parent worldpublic double getHeadingRadians()
public void setHeading(double d)
d
- the orientation, in degreespublic double getHeading()
public void update()
OdorWorldEntity
update
in class OdorWorldEntity
public void postSerializationInit()
postSerializationInit
in class OdorWorldEntity
public java.util.TreeMap<java.lang.Double,Animation> getImageMap()
public void setImageMap(java.util.TreeMap<java.lang.Double,Animation> imageMap)
imageMap
- the imageMap to setpublic java.lang.String getEntityType()
public void setEntityType(java.lang.String type)
type
- the type to setpublic ComboBoxWrapper getType()
public void setType(ComboBoxWrapper imageData)
imageData
- the data from the combo boxpublic void turnLeft(double amount)
amount
- amount to turn left. Assumes a positive number.public void turn(double amount)
amount
- public void turnRight(double amount)
amount
- amount to turn right. Assumes a positive number.public void goStraight(double amount)
amount
-