|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object BeastInfo
public class BeastInfo
A full description of the state of a Beast. Why have this separate class rather than looking directly at the Beast? Well, any method that gets a reference to a Beast can actually CHANGE its state, which a beast brain should be able to do. So, instead, we give the beast brains this info which is immutable (just as a String is immutable).
Constructor Summary | |
---|---|
BeastInfo(Beast beast)
Create a new BeastInfo from the given Beast. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
int |
getAge()
Get the beast's age in steps since creation. |
IBeastBrain |
getBrain()
Get the beast's brain. |
Direction |
getDirection()
Get the beast's direction |
int |
getId()
Get the beast's unique ID (or -1 if no unique ID could be found for the beast). |
BeastMood |
getMood()
Get the beast's mood. |
double |
getX()
Get the beast's x location in the simulation. |
double |
getY()
Get the beast's y location in the simulation. |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BeastInfo(Beast beast)
beast
- the beast to "scrape" info from, non-nullMethod Detail |
---|
public int getId()
public int getAge()
public IBeastBrain getBrain()
public Direction getDirection()
public BeastMood getMood()
public double getX()
public double getY()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |