Class SimpleCommandFactory
Auto-generates ICommandFactory wrappers for SimpleCommand classes. Handles argument parsing based on [Arg] attributes.
public class SimpleCommandFactory : ICommandFactory
- Inheritance
-
objectSimpleCommandFactory
- Implements
Properties
Metadata
public CommandAttribute Metadata { get; }
Property Value
Methods
Create(Type)
Create a factory for a SimpleCommand type.
public static SimpleCommandFactory Create(Type commandType)
Parameters
commandTypeType
Returns
DiscoverAndRegister(CommandRegistry, params Assembly[])
Discover all SimpleCommand types in assemblies and register with CommandRegistry.
public static void DiscoverAndRegister(CommandRegistry registry, params Assembly[] assemblies)
Parameters
registryCommandRegistryassembliesAssembly[]
TryCreateCommand(string[], GameState, out ICommand, out string)
Try to create a command from parsed arguments.
public bool TryCreateCommand(string[] inputArgs, GameState gameState, out ICommand command, out string errorMessage)
Parameters
inputArgsstring[]gameStateGameStateGameState for validation/lookups
commandICommandCreated command if successful
errorMessagestringError message if failed
Returns
- bool
True if command created successfully