Class FreePositionedConnect4


  • public class FreePositionedConnect4
    extends Connect4
    Implementation for a free positioned Connect4 game. This exists since when I started developing, I implemented it so a player can choose both x and y. Later when I started testing it I recognized my mistake.
    • Constructor Detail

      • FreePositionedConnect4

        public FreePositionedConnect4​(java.lang.String firstPlayerName,
                                      java.lang.String secondPlayerName)
        Constructor for a 2 player game free positioned Connect4 game.
        Parameters:
        firstPlayerName - Name of the first player
        secondPlayerName - Name of the second player
    • Method Detail

      • play

        public RoundResult play​(int x)
        Overrides the method to throw an UnsupportedOperationException since it's not allowed to be called on a free positioned Connect4 game.
        Overrides:
        play in class Connect4
        Parameters:
        x - X coordinate which has to be between 1 and 7
        Returns:
        A RoundResult containing a message and a boolean telling if the round was valid