コード例 #1
0
        public WaitingRoomPlayersResponse UpdatePlayer(UpdatePlayerRequest request)
        {
            WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom();

            waitingRoom.UpdatePlayer(request);
            waitingRoom.SaveWaitingRoom();
            return(new WaitingRoomPlayersResponse()
            {
                Players = waitingRoom.Players
            });
        }
コード例 #2
0
        public WaitingRoomGamesResponse LeaveCurrentGame([FromUri] int playerId)
        {
            WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom();

            waitingRoom.LeaveCurrentGame(playerId);
            waitingRoom.SaveWaitingRoom();
            return(new WaitingRoomGamesResponse()
            {
                Games = waitingRoom.Games
            });
        }
コード例 #3
0
        public WaitingRoomPlayersResponse RemovePlayer([FromUri] string socketId)
        {
            WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom();

            waitingRoom.RemovePlayer(socketId);
            waitingRoom.SaveWaitingRoom();
            return(new WaitingRoomPlayersResponse()
            {
                Players = waitingRoom.Players
            });
        }
コード例 #4
0
        public WaitingRoomGamesResponse JoinGame([FromUri] JoinGameRequest request)
        {
            WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom();

            waitingRoom.JoinGame(request);
            waitingRoom.SaveWaitingRoom();
            return(new WaitingRoomGamesResponse()
            {
                Games = waitingRoom.Games
            });
        }
コード例 #5
0
        public WaitingRoomGamesResponse CreateNewGame([FromBody] CreateGameRequest request)
        {
            WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom();

            waitingRoom.AddGame(request);
            waitingRoom.SaveWaitingRoom();
            return(new WaitingRoomGamesResponse()
            {
                Games = waitingRoom.Games
            });
        }
コード例 #6
0
        public WaitingRoomResponse AddChatPlayer([FromBody] AddChatPlayerRequest request)
        {
            WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom();

            waitingRoom.AddPlayer(request);
            waitingRoom.SaveWaitingRoom();
            return(new WaitingRoomResponse()
            {
                WaitingRoom = waitingRoom
            });
        }
コード例 #7
0
        public WaitingRoomResponse PlayerReady([FromBody] PlayerReadyrequest request)
        {
            WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom();

            waitingRoom.PlayerReady(request);
            waitingRoom.SaveWaitingRoom();
            return(new WaitingRoomResponse()
            {
                WaitingRoom = waitingRoom
            });
        }
コード例 #8
0
        public WaitingRoomMessagesResponse AddMessage([FromUri] ChatMessageRequest request)
        {
            WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom();

            waitingRoom.AddMessage(request.PlayerId, request.Message);
            waitingRoom.SaveWaitingRoom();
            return(new WaitingRoomMessagesResponse()
            {
                Messages = waitingRoom.Messages
            });
        }