|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object RandomWalkingBrain
public class RandomWalkingBrain
A beast that takes a random walk around the screen, getting less intense the older it gets and happier the further it is from whatever point it's at the first time getMood is called (which is not necessarily its starting point, but probably is).
Field Summary | |
---|---|
static double |
AGE_RATE
Number of time steps it takes for intensity to fade. |
static double |
PERFECT_GROOVINESS_DISTANCE
The distance beyond which the beast is perfectly happy. |
Constructor Summary | |
---|---|
RandomWalkingBrain()
|
Method Summary | |
---|---|
Direction |
chooseDirection(BeastInfo me,
IPackFinder packFinder)
Choose a direction at random. |
BeastMood |
chooseMood(BeastInfo me,
IPackFinder packFinder)
Choose a mood based on my distance from the first point where I was created. |
double |
getFirstX()
|
double |
getFirstY()
|
boolean |
isInitialized()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static double PERFECT_GROOVINESS_DISTANCE
public static double AGE_RATE
Constructor Detail |
---|
public RandomWalkingBrain()
Method Detail |
---|
public Direction chooseDirection(BeastInfo me, IPackFinder packFinder)
chooseDirection
in interface IBeastBrain
me
- information about this beast (what its brain knows about its
body/state), must be non-nullpackFinder
- a pack finder to tell this beast about its pack (must
be non-null)
public BeastMood chooseMood(BeastInfo me, IPackFinder packFinder)
chooseMood
in interface IBeastBrain
me
- information about this beast (what its brain knows about its
body/state), must be non-nullpackFinder
- a pack finder to tell this beast about its pack (must
be non-null)
public double getFirstX()
public double getFirstY()
public boolean isInitialized()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |