Table of Contents

Class AddGoldCommand

Namespace
StarterKit.Commands
Assembly
StarterKit.dll

StarterKit command: Add or remove gold from player treasury. Demonstrates SimpleCommand pattern with fluent validation.

[Command("add_gold", Aliases = new string[] { "gold" }, Description = "Add or remove gold from treasury", Examples = new string[] { "add_gold 100", "add_gold -50" })]
public class AddGoldCommand : SimpleCommand, ICommand
Inheritance
object
AddGoldCommand
Implements
Inherited Members

Properties

Amount

[Arg(0, "amount")]
public int Amount { get; set; }

Property Value

int

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