示例#1
0
        public override void Play(List <AbstractCharacter> oppositeTeam)
        {
            Display.DialogMessage("Please select a target ");
            AbstractCharacter character = GetNextToAttack();

            character.HisTurnDisplay();
            int  choice;
            bool continueFlag = true;

            do
            {
                WriteCharacterInfo(character);
                choice = GetUserInput();
                if (IsTargetValid(oppositeTeam, choice))
                {
                    continueFlag = false;
                }
                else
                {
                    Display.DialogMessage("Can't attack dead characters ");
                }
            } while (continueFlag);
            oppositeTeam[choice].Block(character.Attack());
            character.Display();
        }
        public override void Play(List <AbstractCharacter> oppositeTeam)
        {
            AbstractCharacter character = GetNextToAttack();

            character.HisTurnDisplay();
            int  choice;
            bool continueFlag = true;

            do
            {
                choice = GenerateRandomInteger(0, oppositeTeam.Count);
                if (IsTargetValid(oppositeTeam, choice))
                {
                    continueFlag = false;
                }
            } while (continueFlag);
            WriteComputerMove(character, choice);
            oppositeTeam[choice].Block(character.Attack());
            character.Display();
        }