java.lang.Object
castle.comp3021.assignment.protocol.Move
All Implemented Interfaces:
java.lang.Cloneable

public class Move
extends java.lang.Object
implements java.lang.Cloneable
Move class represent a move made by a Player, moving a piece from one Place to another Place.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    private Place destination
    Move destination
    private Place source
    Source place of the move.
  • Constructor Summary

    Constructors 
    Constructor Description
    Move​(int sourceX, int sourceY, int destinationX, int destinationY)  
    Move​(Place source, int destinationX, int destinationY)  
    Move​(Place source, Place destination)  
  • Method Summary

    Modifier and Type Method Description
    Move clone()  
    boolean equals​(java.lang.Object o)  
    Place getDestination()  
    Place getSource()  
    int hashCode()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • Move

      public Move​(Place source, Place destination)
    • Move

      public Move​(int sourceX, int sourceY, int destinationX, int destinationY)
    • Move

      public Move​(Place source, int destinationX, int destinationY)
  • Method Details

    • getSource

      public Place getSource()
    • getDestination

      public Place getDestination()
    • equals

      public boolean equals​(java.lang.Object o)
      Overrides:
      equals in class java.lang.Object
    • hashCode

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

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • clone

      public Move clone() throws java.lang.CloneNotSupportedException
      Overrides:
      clone in class java.lang.Object
      Throws:
      java.lang.CloneNotSupportedException