public static void AdvancedDemo() { var game = new Game(); var goblin = new CreatureV2(game, "Strong Goblin", 3, 3); WriteLine(goblin); using (new DoubleAttackModifierV2(game, goblin)) { WriteLine(goblin); using (new IncreaseDefenseModifierV2(game, goblin)) { WriteLine(goblin); } } WriteLine(goblin); }
public DoubleAttackModifierV2(Game game, CreatureV2 creature) : base(game, creature) { }
public IncreaseDefenseModifierV2(Game game, CreatureV2 creature) : base(game, creature) { }
protected CreatureModifierV2(Game game, CreatureV2 creature) { _game = game; Creature = creature; game.Queries += Handle; // here we subscribe }