示例#1
0
        private void ProcessTurn(string[] parts, Guid roundId)
        {
            var turn    = ParseCard(parts[1]);
            var request = new NotifyTurnRequest()
            {
                RoundId = roundId,
                Turn    = turn
            };

            _rm.NotifyTurn(request);
        }
示例#2
0
        public DummyResponse NotifyTurn(NotifyTurnRequest request)
        {
            if (!Rounds.ContainsKey(request.RoundId))
            {
                throw new InvalidOperationException($"Round with {request.RoundId} not found!");
            }

            var round = Rounds[request.RoundId];

            round.Turn = request.Turn;
            round.MoveToNextStage();

            return(new DummyResponse()
            {
                Action = new ExpectedAction
                {
                    Action = ExpectedActionEnum.Decision,
                    PlayerName = round.GetCurrentPlayer().Name
                }
            });
        }
示例#3
0
        public IActionResult NotifyTurn([FromBody] NotifyTurnRequest request)
        {
            var response = RoundManager.Instance.NotifyTurn(request);

            return(Ok(response));
        }