Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var game   = new Game();
            var goblin = new Creature(game, "Goblin", 2, 2);

            WriteLine(goblin);
            WriteLine("Let's double attack...");
            var da = new DoubleAttackModifier(game, goblin);

            WriteLine(goblin);
            WriteLine("Let's increment defense...");
            var id = new IncrementDefenseModifier(game, goblin);

            WriteLine(goblin);
            WriteLine("Let's remove attack modifier...");
            da.Dispose();
            WriteLine(goblin);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            var game  = new Game();
            var fairy = new Creature(game, "Fairy", 5, 1);

            Console.WriteLine(fairy);

            using (var dam = new DoubleAttackModifier(game, fairy))
            {
                Console.WriteLine(fairy);
            }
            Console.WriteLine(fairy);

            using (var idm = new IncreaseDefenseModifier(game, fairy))
            {
                Console.WriteLine(fairy);
            }
            Console.WriteLine(fairy);

            Console.ReadLine();
        }