Interface TictactoeModule

All Superinterfaces:
org.incendo.cloud.execution.CommandExecutionHandler<FPlayer>, ModuleCommand, ModuleLocalization, ModuleSimple

public interface TictactoeModule extends ModuleCommand
The /tictactoe command, which plays a round against another player.
  • Method Details

    • config

      Description copied from interface: ModuleCommand
      The config section for this command, which also holds its aliases.
      Specified by:
      config in interface ModuleCommand
      Specified by:
      config in interface ModuleSimple
      Returns:
      the command settings
    • permission

      Description copied from interface: ModuleSimple
      The permission that gates this module.
      Specified by:
      permission in interface ModuleSimple
      Returns:
      the permission
    • localization

      Localization.Command.Tictactoe localization(FPlayer fPlayer)
      Description copied from interface: ModuleLocalization
      The localization section for a player, picked from their chosen language.
      Specified by:
      localization in interface ModuleLocalization
      Parameters:
      fPlayer - the player the text is for
      Returns:
      the localization settings
    • sendCreateMessage

      void sendCreateMessage(FPlayer fPlayer, FPlayer fReceiver, TicTacToe ticTacToe, UUID metadataUUID)
      Invites a player to a game.
      Parameters:
      fPlayer - who sent the invitation
      fReceiver - who was invited
      ticTacToe - the game
      metadataUUID - the shared message id
    • sendMoveMessage

      void sendMoveMessage(FPlayer fPlayer, FPlayer fReceiver, TicTacToe ticTacToe, int typeTitle, String move, UUID metadataUUID)
      Announces a move and redraws the board.
      Parameters:
      fPlayer - the player who moved
      fReceiver - the opponent
      ticTacToe - the game
      typeTitle - which heading to show
      move - the square played
      metadataUUID - the shared message id
    • executeMove

      void executeMove(FPlayer fPlayer, org.incendo.cloud.context.CommandContext<FPlayer> commandContext)
      Runs the move form of the command.
      Parameters:
      fPlayer - the player moving
      commandContext - the parsed arguments
    • getMoveMessage

      String getMoveMessage(FPlayer fPlayer, FPlayer fResolver, TicTacToe ticTacToe, int typeTile, String move)
      The rendered board plus its heading.
      Parameters:
      fPlayer - the player who moved
      fResolver - the reader
      ticTacToe - the game
      typeTile - which heading to show
      move - the square played
      Returns:
      the rendered board