Esempio n. 1
0
        // 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());
        }
Esempio n. 2
0
 public GoblinKingV3(GameV3 game) : base(game, 3, 3)
 {
 }
Esempio n. 3
0
 public GoblinV3(GameV3 game) : base(game, 1, 1)
 {
 }
Esempio n. 4
0
 protected GoblinV3(GameV3 game, int baseAttack, int baseDefense) : base(game, baseAttack, baseDefense)
 {
 }
Esempio n. 5
0
 protected CreatureV3(GameV3 game, int baseAttack, int baseDefense)
 {
     Game        = game;
     BaseAttack  = baseAttack;
     BaseDefense = baseDefense;
 }