cs4099
Class Move

java.lang.Object
  extended by cs4099.Move

public class Move
extends java.lang.Object

A Move is a specification of a move made, including the ID values of the source and target piles along with a copy of the card that was moved.

Author:
David Newton

Constructor Summary
Move(int sourcepile, int targetpile, Card movedcard)
          Creates a new Move with the specified properties.
 
Method Summary
 boolean equals(Move othermove)
          Compares this Move to another, returning true if the moves are equal.
 java.lang.String toString()
          Creates a String representation of this move, for use in the Suggest list.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Move

public Move(int sourcepile,
            int targetpile,
            Card movedcard)
Creates a new Move with the specified properties.

Parameters:
sourcepile - The ID of the source pile.
targetpile - The ID of the target pile.
movedcard - The card that was moved between the piles.
Method Detail

toString

public java.lang.String toString()
Creates a String representation of this move, for use in the Suggest list.

Overrides:
toString in class java.lang.Object

equals

public boolean equals(Move othermove)
Compares this Move to another, returning true if the moves are equal.

Parameters:
othermove - The move to compare to.
Returns:
true if the moves have the same source and target piles, and move the same card.