Class PersonAI

java.lang.Object
  |
  +--PersonAI
All Implemented Interfaces:
java.lang.Runnable

public class PersonAI
extends java.lang.Object
implements java.lang.Runnable

Class used to move a NPC around the Grid.

See Also:
People, Person, Trainer, Grid

Field Summary
protected static int los
          How far to be able to see in the direction I am facing
 
Constructor Summary
PersonAI(Person p)
          Tie this to a Person to control.
 
Method Summary
protected  void move(int dir)
          Move the Person in the direction specified.
protected  void moveMe()
          Handle the actual Moving, based on a RNG
 void run()
          Move this around the Grid, and sleep a random amount of time.
 void setGrid(Grid g)
          Set the Grid, set to null to kill the thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

los

protected static final int los
How far to be able to see in the direction I am facing

See Also:
Constant Field Values
Constructor Detail

PersonAI

public PersonAI(Person p)
Tie this to a Person to control.

Parameters:
p - the Person to control
Method Detail

move

protected void move(int dir)
             throws NonEmptyException,
                    InvalidLocationException,
                    EmptyLocationException
Move the Person in the direction specified.

Parameters:
dir - the Direction to move
NonEmptyException
InvalidLocationException
EmptyLocationException

moveMe

protected void moveMe()
Handle the actual Moving, based on a RNG


setGrid

public void setGrid(Grid g)
Set the Grid, set to null to kill the thread.

See Also:
Grid

run

public void run()
Move this around the Grid, and sleep a random amount of time.

Specified by:
run in interface java.lang.Runnable