Table of Contents

Class SimpleCommand

Namespace
Core.Commands
Assembly
Core.dll

Simplified command base class with auto-serialization. Use [Command] attribute on class and [Arg] attributes on properties.

Benefits over BaseCommand:

  • No separate factory class needed
  • Auto-serialization of [Arg] properties
  • Auto-generated usage/help text
  • Optional Undo (default no-op)

Use BaseCommand instead when you need:

  • Custom serialization format
  • Complex undo logic
  • Maximum performance (no reflection)
public abstract class SimpleCommand : BaseCommand, ICommand
Inheritance
object
SimpleCommand
Implements
Derived
Inherited Members

Methods

Deserialize(BinaryReader)

Auto-deserializes all [Arg] properties.

public override sealed void Deserialize(BinaryReader reader)

Parameters

reader BinaryReader

Execute(GameState)

Override to implement execution logic.

public override abstract void Execute(GameState gameState)

Parameters

gameState GameState

Serialize(BinaryWriter)

Auto-serializes all [Arg] properties.

public override sealed void Serialize(BinaryWriter writer)

Parameters

writer BinaryWriter

Undo(GameState)

Override to implement undo logic. Default is no-op.

public override void Undo(GameState gameState)

Parameters

gameState GameState

Validate(GameState)

Override to implement validation logic.

public override abstract bool Validate(GameState gameState)

Parameters

gameState GameState

Returns

bool