mixmeta4
Class Move

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by mixmeta4.Move
All Implemented Interfaces:
Action, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess

public class Move
extends java.util.ArrayList
implements Action, java.lang.Cloneable

Move represents a players move. It is implemented as an ArrayList to allow for multiple step moves, such as when pieces are jumped in Draughts, tho only single step moves are currently used and fully supported.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Move()
           
Move(java.awt.Point origin, java.awt.Point destination)
           
 
Method Summary
 java.lang.Object clone()
          currently implemented for single step moves
 java.lang.String getComment()
           
 double getCost()
           
 java.awt.Point getDestination()
          get the destination (last point) of the move
 java.awt.Point getOrigin()
          get the origin of the move
 boolean isReverse(Move move)
          See if this move is the reverse of the argument.
 void setComment(java.lang.String comment)
           
 java.lang.String toString()
           
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

Move

public Move(java.awt.Point origin,
            java.awt.Point destination)

Move

public Move()
Method Detail

clone

public java.lang.Object clone()
currently implemented for single step moves

Overrides:
clone in class java.util.ArrayList

getCost

public double getCost()
Specified by:
getCost in interface Action

getOrigin

public java.awt.Point getOrigin()
get the origin of the move


getDestination

public java.awt.Point getDestination()
get the destination (last point) of the move


isReverse

public boolean isReverse(Move move)
See if this move is the reverse of the argument. Currently only checks end points so strictly only works for single step moves.


toString

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

setComment

public void setComment(java.lang.String comment)

getComment

public java.lang.String getComment()