edu.columbia.cs.coms4701.agent.environments.pente
Class PenteAction

java.lang.Object
  extended by edu.columbia.cs.coms4701.agent.environments.pente.PenteAction
All Implemented Interfaces:
AgentAction

public class PenteAction
extends java.lang.Object
implements AgentAction

Describes a move in the Pente game.

Each move consists of the placement of a stone somewhere on the 19x19 grid.

Version:
0.1

User: aaron Date: Sep 24, 2006 Time: 5:07:07 PM

Author:
aaron@cs

Constructor Summary
PenteAction(DiscretePoint2D theLocation)
          Constructs a new PenteAction for placing a stone in the given location.
PenteAction(int x, int y)
          Constructs a new PenteAction for placing a stone in the given x- and y- coordinates.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 DiscretePoint2D getLocation()
          Returns the location on the 19x19 grid where the player is attempting to place a stone.
 int getTurnNumber()
          Returns an integer indicating which player produced this move.
 int hashCode()
           
 void setTurnNumber(int theTurnNumber)
          Sets the turn number of an action.
 java.lang.String toString()
          AgentActions should override toString() to provide a reasonable short description.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PenteAction

public PenteAction(DiscretePoint2D theLocation)
Constructs a new PenteAction for placing a stone in the given location.

Parameters:
theLocation -

PenteAction

public PenteAction(int x,
                   int y)
Constructs a new PenteAction for placing a stone in the given x- and y- coordinates.

Parameters:
x -
y -
Method Detail

toString

public java.lang.String toString()
Description copied from interface: AgentAction
AgentActions should override toString() to provide a reasonable short description.

Specified by:
toString in interface AgentAction
Overrides:
toString in class java.lang.Object
Returns:
a simple description of the action

getLocation

public DiscretePoint2D getLocation()
Returns the location on the 19x19 grid where the player is attempting to place a stone.

Returns:
integer coordinates

getTurnNumber

public int getTurnNumber()
Returns an integer indicating which player produced this move.

Players do not need to set this themselves -- it will be set as appropriate by the environment.


setTurnNumber

public void setTurnNumber(int theTurnNumber)
Sets the turn number of an action. Actions returned by your agent program's nextAction() method will have their turn number set by the environment, so you can't do anything sneaky like move on behalf of your opponent. However, you might find this method useful for use in your successor method.


equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object