private static void SendEndPhase(User user, PhaseType phaseType, int roundCount) { user.DoAsync(() => { S_END_PHASE endPhase = new S_END_PHASE(); endPhase.GameId = user.SessionId; endPhase.NextPhase = (int)phaseType; endPhase.RoundCount = roundCount; user.Send(endPhase); }); }
private void SendEndAction() { DoAsync(() => { S_END_ACTION endAction = new S_END_ACTION(); endAction.GameId = SessionId; Send(endAction); DoAsync(() => { --MachingRoom.ActionCount; if (MachingRoom.ActionCount == 0) { MachingRoom.NextUser(); S_END_USER_TURN endTurn = new S_END_USER_TURN(); endTurn.GameId = SessionId; endTurn.NextUserGameId = MachingRoom.CurrentUser.SessionId; MachingRoom.Broadcast(endTurn); DoAsync(() => { if (MachingRoom.AllUserEndTurn.All(isEnd => isEnd == true)) { MachingRoom.DoAsyncAll((user) => { S_END_PHASE endPhase = new S_END_PHASE(); endPhase.GameId = user.SessionId; endPhase.NextPhase = (int)PhaseType.Weather; user.Send(endPhase); }); } }); } }); }); }