Class AgentPosition

java.lang.Object
  |
  +--Position
        |
        +--AgentPosition

public class AgentPosition
extends Position

This class will be used to communicate the position of an Agent between your player classes and our game program. Modified so that it extends Position


Field Summary
 
Fields inherited from class Position
x, y
 
Constructor Summary
AgentPosition(int id, int x, int y)
          Creates a new AgentPosition instance.
 
Method Summary
 int getID()
          This method gets the id of the Agent.
 java.lang.String toString()
           
 
Methods inherited from class Position
getXPos, getYPos
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AgentPosition

public AgentPosition(int id,
                     int x,
                     int y)
Creates a new AgentPosition instance.

Parameters:
id - is the id number of the Agent.
x - is the position of the Agnet on the x coordinate
y - is the position of the Agent in the y coordinate
Method Detail

getID

public int getID()
This method gets the id of the Agent. P.S. You will not need to use this method. You are allowed to use only the constructor to make a new AgentPosition instance for the Agent whose position you wish to communicate

Returns:
an int value

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object