Class PlayerVsPlayerGame


  • public class PlayerVsPlayerGame
    extends Game
    Class PlayerVsPlayerGame extend Game class and implement his two abstract methods for games Player versus Player.
    Author:
    Arterm Koliushko, https://www.linkedin.com/in/artem-koliushko/
    • Field Detail

      • PLAYER_2_NAME

        private static final java.lang.String PLAYER_2_NAME
        Constant with a name of the player2(in this case an second user for games Player versus Player). Used in constructor for creation an object of the Game.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PlayerVsPlayerGame

        public PlayerVsPlayerGame()
        Constructor for class PlayerVsPlayerGame.
        Initialize parent(Game class) constructor with a name of second player.
    • Method Detail

      • makeMove

        protected void makeMove()
        This method overrides parent Game.makeMove() method.
        This method just switch current player using Game.switchCurrentPlayer() method.
        Games Player versus Player does not have any logic for making moves.
        Specified by:
        makeMove in class Game