NewCmd

object NewCmd : CommandImpl<Game>

Command to create a new Reversi game.

Creates a new game with the specified starting player:

  • new # [name] — Creates a game where Black (#) goes first

  • new @ [name] — Creates a game where White (@) goes first

If a game name is provided, the game is saved to persistent storage. If no name is given, the game exists only in memory (local game). The name must be unique; attempting to create a game with an existing name will fail.

If a game is already in progress, it is automatically saved before creating the new game.

Properties

Link copied to clipboard
open override val info: CommandInfo

Functions

Link copied to clipboard
open override fun execute(vararg args: String, context: Game?): CommandResult<Game>

Executes the new game creation command.