Interface StrategicTurningPoint

All Known Implementing Classes:
StrategicTurningPoint.CenterSquareControl, StrategicTurningPoint.GameWon, StrategicTurningPoint.ImmediateLossPrevention

A strategic turning point in a game of Tic-Tac-Toe.
  • Method Details

    • playerMarker

      String playerMarker()
      The player marker for the player who made the strategic move.
    • gameState

      GameState gameState()
      The game state at the strategic turning point.
    • moveNumber

      int moveNumber()
      The move number at the strategic turning point.
    • priorityLevel

      The priority level of the strategic turning point.
    • moveTakesCenterSquareControl

      static boolean moveTakesCenterSquareControl(GameState prevGameState, GameState gameState)
      Check for a strategic turning point where the player has control of the center square.
      Parameters:
      prevGameState - the game state before the strategic move
      gameState - the game state after the strategic move
      Returns:
      true if the strategic turning point is a center square control
    • movePreventedImmediateLoss

      static boolean movePreventedImmediateLoss(GameState prevGameState, GameState gameState)
      Check for a strategic turning point where the player is about to lose.
      Parameters:
      prevGameState - the game state before the strategic move
      gameState - the game state after the strategic move
      Returns:
      true if the player is about to lose, false otherwise
    • moveWinsGame

      static boolean moveWinsGame(GameState gameState)
      Check for a strategic turning point where the player has won the game.
      Parameters:
      gameState - the game state after the strategic move return true if the player has won the game, false otherwise
    • from

      static Optional<StrategicTurningPoint> from(GameState prevGameState, GameState gameState, int moveNumber)