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++; } } } }
public void SecondCharecterAttack(CharacterOne one, CharacterTwo two) { one.countLife -= two.Hit(); }
public void FirstCharecterHit(CharacterOne one, CharacterTwo two) { two.countLife -= one.Hit(); }