public WaitingRoomPlayersResponse UpdatePlayer(UpdatePlayerRequest request) { WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom(); waitingRoom.UpdatePlayer(request); waitingRoom.SaveWaitingRoom(); return(new WaitingRoomPlayersResponse() { Players = waitingRoom.Players }); }
public WaitingRoomGamesResponse LeaveCurrentGame([FromUri] int playerId) { WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom(); waitingRoom.LeaveCurrentGame(playerId); waitingRoom.SaveWaitingRoom(); return(new WaitingRoomGamesResponse() { Games = waitingRoom.Games }); }
public WaitingRoomPlayersResponse RemovePlayer([FromUri] string socketId) { WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom(); waitingRoom.RemovePlayer(socketId); waitingRoom.SaveWaitingRoom(); return(new WaitingRoomPlayersResponse() { Players = waitingRoom.Players }); }
public WaitingRoomGamesResponse JoinGame([FromUri] JoinGameRequest request) { WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom(); waitingRoom.JoinGame(request); waitingRoom.SaveWaitingRoom(); return(new WaitingRoomGamesResponse() { Games = waitingRoom.Games }); }
public WaitingRoomGamesResponse CreateNewGame([FromBody] CreateGameRequest request) { WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom(); waitingRoom.AddGame(request); waitingRoom.SaveWaitingRoom(); return(new WaitingRoomGamesResponse() { Games = waitingRoom.Games }); }
public WaitingRoomResponse AddChatPlayer([FromBody] AddChatPlayerRequest request) { WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom(); waitingRoom.AddPlayer(request); waitingRoom.SaveWaitingRoom(); return(new WaitingRoomResponse() { WaitingRoom = waitingRoom }); }
public WaitingRoomResponse PlayerReady([FromBody] PlayerReadyrequest request) { WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom(); waitingRoom.PlayerReady(request); waitingRoom.SaveWaitingRoom(); return(new WaitingRoomResponse() { WaitingRoom = waitingRoom }); }
public WaitingRoomMessagesResponse AddMessage([FromUri] ChatMessageRequest request) { WaitingRoom waitingRoom = WaitingRoom.GetWaitingRoom(); waitingRoom.AddMessage(request.PlayerId, request.Message); waitingRoom.SaveWaitingRoom(); return(new WaitingRoomMessagesResponse() { Messages = waitingRoom.Messages }); }