Table of Contents

Class CreateUnitCommand

Namespace
StarterKit.Commands
Assembly
StarterKit.dll

StarterKit command: Create a unit at a province. Handles gold cost and creates the unit. Uses type-safe ProvinceId wrapper for compile-time safety.

[Command("create_unit", Aliases = new string[] { "unit", "spawn" }, Description = "Create a unit at a province", Examples = new string[] { "create_unit infantry 5", "unit cavalry 10" })]
public class CreateUnitCommand : SimpleCommand, ICommand
Inheritance
object
CreateUnitCommand
Implements
Inherited Members

Properties

CountryId

[Arg(2, "countryId")]
public ushort CountryId { get; set; }

Property Value

ushort

ProvinceId

[Arg(1, "provinceId")]
public ProvinceId ProvinceId { get; set; }

Property Value

ProvinceId

UnitTypeId

[Arg(0, "unitType")]
public string UnitTypeId { get; set; }

Property Value

string

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