Пример #1
0
        public ActionResult Play(string id, int?indexOfCard, bool?willPick, string buriedCardIndicies)
        {
            var repository = new OldGameRepository(GameDictionary.Instance.Dictionary);
            var game       = repository.GetById(Guid.Parse(id));

            switch (game.TurnType)
            {
            case TurnType.BeginHand:
                break;

            case TurnType.Pick:
                Pick(game, willPick.Value);
                break;

            case TurnType.Bury:
                Bury(game, buriedCardIndicies, false);
                break;

            case TurnType.PlayTrick:
                if (indexOfCard.HasValue)
                {
                    PlayTrick(game, indexOfCard.Value);
                }
                break;
            }
            return(RedirectToAction("Play", new { id = game.Id }));
        }
Пример #2
0
        public ActionResult Play(string id)
        {
            var repository = new OldGameRepository(GameDictionary.Instance.Dictionary);
            var game       = repository.GetById(Guid.Parse(id));
            var turnState  = game.TurnState;

            switch (game.TurnType)
            {
            case TurnType.BeginHand:
                turnState.Hand = new Hand(game, _rnd);
                break;

            case TurnType.Pick:
                game.PlayNonHumanPickTurns(true);
                break;

            case TurnType.PlayTrick:
                game.PlayNonHumansInTrick();
                break;
            }
            return(View(turnState));
        }