Esempio n. 1
0
        public void FightWnenCharacterOneStartedFirst()
        {
            Console.WriteLine(" !! Бой начинает первый персонаж !! ");
            CharacterOne one = new CharacterOne();
            CharacterTwo two = new CharacterTwo();

            one.Freeze     += Displayed;
            two.Oglyshenie += Displayed;
            int index = 0;

            while (true)


            {
                //index++;
                if (++index % 2 != 0)
                {
                    FirstCharecterHit(one, two);
                    if (two.Dead())
                    {
                        Console.WriteLine("Второй персонаж умер! Первый победил!!");
                        winPlayerOne++;
                        break;
                    }
                    if (one.FreezeHit())
                    {
                        index++;
                    }
                }
                else
                {
                    SecondCharecterAttack(one, two);
                    if (one.Dead())
                    {
                        Console.WriteLine("Первый персонаж умер! Второй победил!!");
                        winPlayerTwo++;
                        break;
                    }
                    if (two.OglyshenieHit())
                    {
                        index++;
                    }
                }
            }
        }
Esempio n. 2
0
 public void SecondCharecterAttack(CharacterOne one, CharacterTwo two)
 {
     one.countLife -= two.Hit();
 }
Esempio n. 3
0
 public void FirstCharecterHit(CharacterOne one, CharacterTwo two)
 {
     two.countLife -= one.Hit();
 }