private void ProcessTurn(string[] parts, Guid roundId) { var turn = ParseCard(parts[1]); var request = new NotifyTurnRequest() { RoundId = roundId, Turn = turn }; _rm.NotifyTurn(request); }
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 } }); }
public IActionResult NotifyTurn([FromBody] NotifyTurnRequest request) { var response = RoundManager.Instance.NotifyTurn(request); return(Ok(response)); }