Example #1
0
        public void StepInGame()
        {
            _moveCount++;
            List <Card> tmp = new List <Card>();

            while (!_player[0].Lose() && !_player[1].Lose())
            {
                Card firstCard  = _player[0].DequeueCard();
                Card secondCard = _player[1].DequeueCard();

                tmp.Add(firstCard);
                tmp.Add(secondCard);

#if (ShortGame)
                if (_moveCount > 30 && (firstCard.GetCardNumber() == secondCard.GetCardNumber()))
                {
                    for (int i = 0; i < 4; i++)
                    {
                        if (_player[0].Lose() == false && _player[1].Lose() == false)
                        {
                            firstCard  = _player[0].DequeueCard();
                            secondCard = _player[1].DequeueCard();

                            tmp.Add(firstCard);
                            tmp.Add(secondCard);
                        }
                    }
                }
#endif
                if (firstCard.GetCardNumber() > secondCard.GetCardNumber())
                {
                    _player[0].AddCard(tmp);
                    break;
                }
                if (firstCard.GetCardNumber() < secondCard.GetCardNumber())
                {
                    _player[1].AddCard(tmp);
                    break;
                }
                //if (firstCard.Id % 14 == secondCard.Id % 14)
                //{
                //    int x=0;
                //}
            }

            Console.WriteLine(ToString());
        }