Class Turn

  • All Implemented Interfaces:
    java.io.Serializable

    public class Turn
    extends java.lang.Object
    implements java.io.Serializable
    This class represents one turn, made by a player. It consists of moving the amazon and then shooting an arrow from its new position.
    Version:
    1.0
    Author:
    Tim Storm
    See Also:
    Serialized Form
    • Constructor Detail

      • Turn

        public Turn​(Square moveStart,
                    Square moveEnd,
                    Square shot,
                    Player player)
        Constructs a turn from one Square to another Square.
        Parameters:
        moveStart - the Square the move is starting on
        moveEnd - the Square the move ends on
        shot - the Square where an arrow is shot after the move
        player - the Player executing the turn
      • Turn

        public Turn​(int startRow,
                    int startColumn,
                    int endRow,
                    int endColumn,
                    int shotRow,
                    int shotColumn,
                    Player player)
        A convenience wrapper to construct a turn with coodinates.
        Parameters:
        startRow - the row of the starting position
        startColumn - the column of the starting position
        endRow - the row of the ending position
        endColumn - the column of the ending position
        shotRow - the row of the shot target
        shotColumn - the column of the shot target
        player - the Player executing the turn
    • Method Detail

      • getPlayer

        public Player getPlayer()
      • getPlayerId

        public int getPlayerId()
      • getShot

        public Square getShot()
      • getMoveStart

        public Square getMoveStart()
      • getMoveEnd

        public Square getMoveEnd()
      • getMove

        public org.swtpra1.amazongame.Turn.Move getMove()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • 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