Class TicTacToeCommand
Starts a game of tic-tac-toe that takes over the console, demonstrating a full screen driven from a console command.
Implements
Inherited Members
Namespace: Scylla.Console.TextMode
Assembly: ScyllaTextMode.ConsoleDisplay.dll
Syntax
public sealed class TicTacToeCommand : ConsoleCommandBase, IConsoleCommand, IConsoleCommandHelp
Remarks
Syntax: tictactoe. Takes no arguments. The game replaces the console's log for
as long as it runs and gives it back untouched on Q.
Requires the Terminal Emulation display backend, because a screen needs a character grid to draw into and the TextMeshPro backends render the log as one styled string. On those the command reports what is needed rather than failing obscurely.
Registered by the ConsoleDisplay bridge, so the command exists exactly when the TextMode module is present, which is also exactly when it can run.
Properties
Description
Gets a short, single-line description of what the command does, shown next to its name in the full command listing produced by the built-in help command.
Declaration
public override string Description { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Examples
Example invocations shown in this command's own help entry.
Declaration
public override ReadOnlySpan<ConsoleCommandExample> Examples { get; }
Property Value
| Type | Description |
|---|---|
| ReadOnlySpan<ConsoleCommandExample> |
Overrides
Name
Gets the primary, case-insensitive name used to invoke the command, for example
time.scale. This is also the identity the registry checks when rejecting a
duplicate registration, and the name a command must be unregistered by.
Declaration
public override string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Summary
The explanation shown in this command's own help entry.
Declaration
public override string Summary { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Usage
Gets the usage pattern shown when the command is invoked with the wrong number of
arguments (see InvalidArgs(string)) and in the command's
individual help entry. Defaults to Scylla.Console.ConsoleCommandBase.Name; override this for a command
that takes arguments so the usage string documents them, for example
"scene.load <name> [--additive] [--manual]".
Declaration
public override string Usage { get; }
Property Value
| Type | Description |
|---|---|
| string |
Overrides
Methods
Execute(ConsoleCommandArgs, IConsoleCommandContext)
Executes the command with the given arguments and context.
Declaration
public override ConsoleCommandResult Execute(ConsoleCommandArgs args, IConsoleCommandContext context)
Parameters
| Type | Name | Description |
|---|---|---|
| ConsoleCommandArgs | args | The arguments parsed from the command line, following the command name itself. |
| IConsoleCommandContext | context | The execution context, used to write output, look up other commands, or inspect history. |
Returns
| Type | Description |
|---|---|
| ConsoleCommandResult | A Scylla.Console.ConsoleCommandResult describing the outcome. Return
Scylla.Console.ConsoleCommandResult.Success() or a variant carrying a message for the
ordinary case, InvalidArgs(string) when
|
Overrides
Remarks
Scylla.Console.ConsoleCommandExecutor calls this once per invocation, on the main thread, after successfully parsing the input and looking up the command by name. An implementation should prefer returning an error result over throwing for an expected failure, such as a bad argument or a missing dependency, since a returned result carries a clean message to the console while an exception is only caught, logged, and reported as a generic failure by the executor.