|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sg.edu.nus.comp.cs3243.pipedream.Action
Action is the class that completely specifies what an agent does for a specific turn instance. It encapsulates the action information needed by the pipedream.Driver class to perform the agent's action for a turn.
N.B. the mutator methods in Action don't validate the arguments of the action. Programmers using these methods will have to validate them on their own.
$Log: Action.java,v $ Revision 1.3 2004/01/15 05:29:46 rpnlpir Added RCS tags to file.
Constructor Summary | |
Action()
Initializes the Action to have a WAIT_ACTION and x and y coordinates set to -1. |
|
Action(char action,
int x,
int y)
Constructor that takes all three parameters of an Action as input. |
Method Summary | |
char |
getAction()
An accessor method to return an Action's type of action. |
int |
getX()
An accessor method to get the x coordinate of the action. |
int |
getY()
An accessor method to get the Y coordinate of the action. |
void |
setAction(char action)
A mutator method to set the type of action. |
void |
setX(int x)
A mutator method to set the X coordinate of the action. |
void |
setY(int y)
A mutator method to set the Y coordinate of the action. |
java.lang.String |
toString()
A method that creates a printable version of this Action. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public Action()
Constants.WAIT_ACTION
public Action(char action, int x, int y)
action
- the action type of this object.
x the x coordinate for this action.
y the y coordinate for this action.Method Detail |
public void setAction(char action)
action
- a char that specifies the type of action embodied
by this object.getAction()
public char getAction()
setAction(char)
public void setX(int x)
x
- an int that specifies the x coordination of this action.getX()
public int getX()
setX(int)
public void setY(int y)
y
- an int that specifies the y coordination of this action.getY()
public int getY()
setY(int)
public java.lang.String toString()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |