Table of Contents

Class DisbandUnitCommand

Namespace
StarterKit.Commands
Assembly
StarterKit.dll

StarterKit command: Disband a unit. Demonstrates fluent validation with UnitExists validator. Uses type-safe ProvinceId wrapper for compile-time safety.

[Command("disband_unit", Aliases = new string[] { "disband", "kill" }, Description = "Disband a unit", Examples = new string[] { "disband_unit 1", "disband 2" })]
public class DisbandUnitCommand : SimpleCommand, ICommand
Inheritance
object
DisbandUnitCommand
Implements
Inherited Members

Properties

UnitId

[Arg(0, "unitId")]
public ushort UnitId { get; set; }

Property Value

ushort

Methods

Execute(GameState)

Override to implement execution logic.

public override void Execute(GameState gameState)

Parameters

gameState GameState

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 bool Validate(GameState gameState)

Parameters

gameState GameState

Returns

bool