Exemple #1
0
        static void Main(string[] args)
        {
            ISword  Sword  = Generator.Sword();
            IShield Shield = Generator.Shield();
            //Constructor DI
            Warrior     warrior = Generator.MakeWarrior(Sword, Shield);
            Preparation p       = Generator.MakePreperations();

            p.BattlePreperation();

            IDragon dragon = Generator.MakeDragon(p.dragonType);

            IBattle Battle = Generator.Battle(p.sword, p.shield);

            Battle.Clash(warrior, dragon);

            Battle.BattleOutcome(warrior, dragon);

            Console.ReadKey();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Warrior     warrior = Generator.MakeWarrior();
            Preparation p       = Generator.MakePreperations();

            p.BattlePreperation();
            //Method DI
            warrior.EquipWeapon(new Weapon());
            warrior.EquipShield(new Shield());


            IDragon dragon = Generator.MakeDragon(p.dragonType);
            IBattle Battle = Generator.Battle(p.sword, p.shield);

            Battle.Clash(warrior, dragon);

            Battle.BattleOutcome(warrior, dragon);

            Console.ReadKey();
        }