checkers.model
Class Move

java.lang.Object
  extended by checkers.model.Move
All Implemented Interfaces:
java.io.Serializable

public class Move
extends java.lang.Object
implements java.io.Serializable

An object representation of a move.

Author:
See Also:
Serialized Form

Constructor Summary
Move(int startLoc, int endLoc)
          Create a move with the starting location and ending location passed in as paremeters.
 
Method Summary
 int endLocation()
          Return the ending location of this move.
 int getJumpIndex()
          If the move is a jump, returns the index of the jumped piece.
 boolean isJump()
          Returns true if the move is a jump.
 int startLocation()
          Return the starting location of this move.
 java.lang.String toString()
          String representation of move
 boolean validate()
          Returns true if the move is valid.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Move

public Move(int startLoc,
            int endLoc)
Create a move with the starting location and ending location passed in as paremeters.

Parameters:
startLoc - The starting point of the move
endLoc - The ending point of the move
Method Detail

startLocation

public int startLocation()
Return the starting location of this move.

Returns:
The starting point of the move.

endLocation

public int endLocation()
Return the ending location of this move.

Returns:
The ending point of this location.

validate

public boolean validate()
Returns true if the move is valid.

Returns:
valid

isJump

public boolean isJump()
Returns true if the move is a jump.

Returns:
jump

getJumpIndex

public int getJumpIndex()
If the move is a jump, returns the index of the jumped piece.

Returns:
index

toString

public java.lang.String toString()
String representation of move

Overrides:
toString in class java.lang.Object