Package Helper

Class Move


  • public class Move
    extends java.lang.Object
    Move class represents a move in the Domineering game, consisting of two positions and the player making the move.
    Since:
    2023-12-01
    Version:
    1.0
    Author:
    Laamiri Ouail & Hajar Sadik
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private byte player
      The player making the move (1 or 2).
      private Position position1
      The first position of the move.
      private Position posotion2
      The second position of the move.
    • Constructor Summary

      Constructors 
      Constructor Description
      Move​(Position position1, Position position2, byte player)
      Constructs a Move object with the specified positions and player.
    • Field Detail

      • position1

        private Position position1
        The first position of the move.
      • posotion2

        private Position posotion2
        The second position of the move.
      • player

        private byte player
        The player making the move (1 or 2).
    • Constructor Detail

      • Move

        public Move​(Position position1,
                    Position position2,
                    byte player)
        Constructs a Move object with the specified positions and player.
        Parameters:
        position1 - The first position of the move.
        position2 - The second position of the move.
        player - The player making the move.
    • Method Detail

      • getPosition1

        public Position getPosition1()
        Gets the first position of the move.
        Returns:
        The first position of the move.
      • getPosotion2

        public Position getPosotion2()
        Gets the second position of the move.
        Returns:
        The second position of the move.
      • hasPosition

        public boolean hasPosition​(Position position)
        Checks if the move has a specific position.
        Parameters:
        position - The position to check.
        Returns:
        True if the move has the specified position, false otherwise.
      • getPlayer

        public byte getPlayer()
        Gets the player making the move.
        Returns:
        The player making the move (1 or 2).