Table of Contents

Interface ICommandFactory

Namespace
Core.Commands
Assembly
Core.dll

Factory for creating commands from string arguments. Parses debug console input and creates ICommand instances.

Implement this interface and add [CommandMetadata] attribute for automatic discovery by CommandRegistry.

public interface ICommandFactory

Methods

TryCreateCommand(string[], GameState, out ICommand, out string)

Try to create a command from parsed arguments.

bool TryCreateCommand(string[] args, GameState gameState, out ICommand command, out string errorMessage)

Parameters

args string[]

Command arguments (excludes command name itself)

gameState GameState

GameState for validation/lookups

command ICommand

Created command if successful

errorMessage string

Error message if failed

Returns

bool

True if command created successfully