static void Main(string[] args) { var goblin = new Creature("Goblin", 2, 2); var root = new CreatureModifier(goblin); root.Add(new NoBonusesModifier(goblin)); WriteLine("Lets double attack"); root.Add(new DoubleAttackModifier(goblin)); WriteLine("Lets Increase defense"); root.Add(new IncreaseDefenseModifier(goblin)); root.Handle(); WriteLine(goblin); var game = new Game(); var goblin2 = new Creature2(game, "Strong Goblin", 3, 3); WriteLine(goblin2); using (new DoubleAttackModifier2(game, goblin2)) { WriteLine(goblin2); using (new IncreaseDefenseModifier2(game, goblin2)) { WriteLine(goblin2); } } WriteLine(goblin2); }
public DoubleAttackModifier2(Game game, Creature2 creature2) : base(game, creature2) { }
public IncreaseDefenseModifier2(Game game, Creature2 creature2) : base(game, creature2) { }
protected CreatureModifier2(Game game, Creature2 creature2) { this.game = game; this.creature2 = creature2; game.Queries += Handle; }