예제 #1
0
        static void Main(string[] args)
        {
            var goblin = new Creature("Goblin", 2, 2);
            var root   = new CreatureModifier(goblin);

            WriteLine("Let's double the goblin's attack");
            root.Add(new DoubleAttackModifier(goblin));

            WriteLine("Let's increase goblin's defense");

            root.Add(new IncreasedDefenseModifier(goblin));


            root.Handle();

            WriteLine(goblin);
        }
예제 #2
0
 public virtual void Handle() => next?.Handle();