Class Pawn

java.lang.Object
com.mygdx.game.Logic.Pawn
All Implemented Interfaces:
java.io.Serializable

public class Pawn
extends java.lang.Object
implements java.io.Serializable
Represents the pawn of the Player
Stores a current and an old Square to define its location
See Also:
Serialized Form
  • Constructor Summary

    Constructors
    Constructor Description
    Pawn​(java.lang.String name)  
  • Method Summary

    Modifier and Type Method Description
    Square getCurrentSquare()  
    Square getOldSquare()  
    void setCurrentSquare​(Square currentSquare)
    Sets the input parameter as the currentSquare and its previous value to the oldSquare
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Pawn

      public Pawn​(java.lang.String name)
      Parameters:
      name - Creates a Pawn Object
  • Method Details

    • setCurrentSquare

      public void setCurrentSquare​(Square currentSquare)
      Sets the input parameter as the currentSquare and its previous value to the oldSquare
      Parameters:
      currentSquare - A Square from the board
    • getCurrentSquare

      public Square getCurrentSquare()
    • getOldSquare

      public Square getOldSquare()
    • toString

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