Class Move

java.lang.Object
  |
  +--Move

public class Move
extends java.lang.Object

An object of this class represents a move that could be applied to a game state.


Field Summary
 int fx
          x-coordinate of square from which piece is being moved, or -1 if new piece is just being placed on the board.
 int fy
          y-coordinate of square from which piece is being moved, or -1 if new piece is just being placed on the board.
 int tx
          x-coordinate of square to which piece is being moved.
 int ty
          y-coordinate of square to which piece is being moved.
 
Constructor Summary
Move(int tx, int ty)
          Constructs a move representing placing a new game piece at position tx,ty.
Move(int fx, int fy, int tx, int ty)
          Constructs a move representing moving a game piece from fx,fy to tx,ty.
 
Method Summary
 boolean equals(java.lang.Object o)
          Compares the specified object to this move for equality.
 java.lang.String toString()
          Produces a description of this Move object.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fx

public int fx
x-coordinate of square from which piece is being moved, or -1 if new piece is just being placed on the board.


fy

public int fy
y-coordinate of square from which piece is being moved, or -1 if new piece is just being placed on the board.


tx

public int tx
x-coordinate of square to which piece is being moved.


ty

public int ty
y-coordinate of square to which piece is being moved.

Constructor Detail

Move

public Move(int tx,
            int ty)
Constructs a move representing placing a new game piece at position tx,ty.


Move

public Move(int fx,
            int fy,
            int tx,
            int ty)
Constructs a move representing moving a game piece from fx,fy to tx,ty.

Method Detail

toString

public java.lang.String toString()
Produces a description of this Move object.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Compares the specified object to this move for equality. Returns true if the object is also a Move object, and if it represents an identical move.

Overrides:
equals in class java.lang.Object
Parameters:
o - object to be compared