wworld
Class Actor

java.lang.Object
  |
  +--wworld.WorldObject
        |
        +--wworld.GridObject
              |
              +--wworld.MovingObject
                    |
                    +--wworld.Actor
Direct Known Subclasses:
Agent, Wumpus

public class Actor
extends MovingObject

This class specializes the MovingObject class to include a State that each moving object can have.


Constructor Summary
Actor(int objType, int x, int y, int o, int idnumber, java.lang.String name)
          Constructor that takes in the ObjectType, GridLocation in terms of x and y, the orientation o, the id number of the Actor, and the name assigned to the actor.
 
Method Summary
 int getActorId()
          Returns the ID of the Actor as an integer.
 java.lang.String getActorName()
          Returns the Name of the actor.
 ActorState getState()
          Returns the State of the Actor as being ActorState.ALIVE, ActorState.DEAD or ActorState.VICTORIOUS.
 void setState(int s)
          Allows the simulator to set the State of the Actor.
 
Methods inherited from class wworld.MovingObject
getOrientation, getOrientationDirection, getOrigOrientation, move, setOrientation, turnLeft, turnRight
 
Methods inherited from class wworld.GridObject
getLocation, getOrigLocation, setLocation, setLocation
 
Methods inherited from class wworld.WorldObject
getType, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Actor

public Actor(int objType,
             int x,
             int y,
             int o,
             int idnumber,
             java.lang.String name)
Constructor that takes in the ObjectType, GridLocation in terms of x and y, the orientation o, the id number of the Actor, and the name assigned to the actor.

Method Detail

getActorId

public int getActorId()
Returns the ID of the Actor as an integer.

Returns:
ID of the Actor

getActorName

public java.lang.String getActorName()
Returns the Name of the actor.

Returns:
Name of the actor.

getState

public ActorState getState()
Returns the State of the Actor as being ActorState.ALIVE, ActorState.DEAD or ActorState.VICTORIOUS.

Returns:
State of the agent (ALIVE, DEAD OR VICTORIOUS)

setState

public void setState(int s)
Allows the simulator to set the State of the Actor.