// Chain of Responsibility can be implemented as a chain of references or a centralized construct. // Enlist objects in the chain, possibly controlling their order. // Object removal from chain (e.g., in Dispose()). public static void DemoNumberThree() { var game = new GameV3(); var goblin = new GoblinV3(game); game.Creatures.Add(goblin); WriteLine(goblin.ToString()); var goblin2 = new GoblinV3(game); game.Creatures.Add(goblin2); WriteLine(goblin2.ToString()); var goblin3 = new GoblinKingV3(game); game.Creatures.Add(goblin3); WriteLine(goblin3.ToString()); }
public GoblinKingV3(GameV3 game) : base(game, 3, 3) { }
public GoblinV3(GameV3 game) : base(game, 1, 1) { }
protected GoblinV3(GameV3 game, int baseAttack, int baseDefense) : base(game, baseAttack, baseDefense) { }
protected CreatureV3(GameV3 game, int baseAttack, int baseDefense) { Game = game; BaseAttack = baseAttack; BaseDefense = baseDefense; }