Пример #1
0
        public void UpdateGameState(Game game)
        {
            TurnContext tempQualifier = game.CurrentTurn;

            if (tempQualifier.ActivePlayer.Hand.OfType <IActionCard>().Any() == false || tempQualifier.RemainingActions == 0)
            {
                tempQualifier.MoveToBuyStep();
            }
        }
Пример #2
0
        private void AutomaticallyProgress()
        {
            while (true)
            {
                if (_game.IsComplete)
                {
                    break;
                }

                TurnContext currentTurn = _game.CurrentTurn;

                if (currentTurn.GetCurrentEffect() != null)
                {
                    break;
                }

                if (currentTurn.InBuyStep)
                {
                    if (currentTurn.Buys == 0)
                    {
                        _game.EndTurn();
                        continue;
                    }
                }
                else
                {
                    if (currentTurn.ActivePlayer.Hand.OfType <IActionCard>().Any() == false || currentTurn.RemainingActions == 0)
                    {
                        currentTurn.MoveToBuyStep();
                        continue;
                    }
                }

                break;
            }
        }