예제 #1
0
        public void TestAlive()
        {
            Character       test1  = new Wizard("test");
            Character       test2  = new Troll("test");
            AttackEncounter attack = new AttackEncounter(test1, test2); // los hago pelear, permitiendo que test1 inicie el encuentro
            //dado el daño de wizard, troll debería seguir vivo
            bool expected = false;

            Assert.AreEqual(expected, test2.IsDead);
        }
예제 #2
0
        /// <summary>
        /// Ejecución del escenario.
        /// </summary>
        public virtual void Run()
        {
            Encounter battleOne = new AttackEncounter(characters[0], characters[1]);
            Encounter battleTwo = new AttackEncounter(characters[2], characters[3]);

            RemoveDeadChar();
            Encounter finalBattle = new AttackEncounter(characters[0], characters[1]);

            RemoveDeadChar();
            Console.WriteLine($"The Winner is : {characters[0].Name}");
        }
예제 #3
0
        static void Main(string[] args)
        {
            // IScenario scenario = new ConsoleScenario();
            // scenario.Setup();
            // scenario.Run();
            Elf elfo = new Elf("El Elfo");
            Wizard wizard = new Wizard("El Mago");
            Troll troll = new Troll("El Troll");

            Coraza coraza = new Coraza();
            Cuchillo cuchillo = new Cuchillo();
            Magic magic = new Magic();
            Martillo martillo = new Martillo();
            Palo palo = new Palo();
            Rifle rifle = new Rifle();
            RifleConCuchillo rifleConCuchillo = new RifleConCuchillo();
            Robes robes = new Robes();

            List<IGema> Gemas = new List<IGema>();
            Gemas.Add(new GemaAmarilla());
            Gemas.Add(new GemaCeleste());
            Gemas.Add(new GemaRoja());

            GuanteDePoder guanteDePoder  = new GuanteDePoder(Gemas);         

            elfo.AddItem(magic);
            elfo.AddItem(robes);
            wizard.AddItem(guanteDePoder);
            troll.AddItem(rifleConCuchillo);

            AttackEncounter attackEncounter = new AttackEncounter(elfo,wizard);
            ConsoleReporter consoleReporter = new ConsoleReporter();
            attackEncounter.Reporter = consoleReporter;
            attackEncounter.DoEncounter();
            AttackEncounter attackEncounter1 = new AttackEncounter(wizard, troll);
            attackEncounter1.Reporter = consoleReporter;
            attackEncounter1.DoEncounter();

        }