Beispiel #1
0
        private void ProcessRiver(string[] parts, Guid roundId)
        {
            var river   = ParseCard(parts[1]);
            var request = new NotifyRiverRequest()
            {
                RoundId = roundId,
                River   = river
            };

            _rm.NotifyRiver(request);
        }
Beispiel #2
0
        public DummyResponse NotifyRiver(NotifyRiverRequest request)
        {
            if (!Rounds.ContainsKey(request.RoundId))
            {
                throw new InvalidOperationException($"Round with {request.RoundId} not found!");
            }

            var round = Rounds[request.RoundId];

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

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

            return(Ok(response));
        }