//request from client
        bool IMakaoGameHostService.DeletePlayerFromRoom(LeaveTheRoomRequest request)
        {
            (bool playerDeleted, bool playerWasHost) = MakaoEngineHostDataPlaceholders.DeletePlayerFromRoom(request);

            if (request.ClosedWindowType == LeavingTheRoomWindowType.MainWindow)
            {
                if (playerDeleted && playerWasHost)
                {
                    InfoSenderClass Sender = new InfoSenderClass();
                    Sender.DeleteTheRoom(ClientInfoType.ClosedByHost);
                }
                else if (playerDeleted)
                {
                    InfoSenderClass Sender = new InfoSenderClass();
                    Sender.StartSendingInfoABoutChangeInCurrentPlayerList();
                }
            }
            else
            {
                InfoSenderClass Sender = new InfoSenderClass();
                Sender.DeleteTheRoom(ClientInfoType.PlayerLeftGame);
            }

            return(playerDeleted);
        }
        //request from client (fired by client)
        CurrentPlayersListDataResponse IMakaoGameHostService.GetCurrentPlayersInTheRoomData()
        {
            List <PlayersInRoomData> responseList = new List <PlayersInRoomData>();

            foreach (PlayerData item in MakaoEngineHostDataPlaceholders.PlayersData)
            {
                PlayersInRoomData onePlayerData = new PlayersInRoomData()
                {
                    PlayerName        = item.PlayerName,
                    PlayedGames       = item.PlayedGames,
                    PlayedAndWonGames = item.PlayedAndWonGames,
                    Endpoint          = item.PlayerEndpoint,
                    IsHost            = item.IsHostPlayer,
                    PlayerID          = item.PlayerID,
                    PlayerNumber      = item.PlayerNumber,
                    ReadyToPlay       = item.ReadyToPlay,
                };
                responseList.Add(onePlayerData);
            }

            CurrentPlayersListDataResponse response = new CurrentPlayersListDataResponse
            {
                CurrentPLayersData = responseList,
                RoomIsFull         = MakaoEngineHostDataPlaceholders.CheckIfRoomIsFull(),
            };

            return(response);
        }
        //method that does the job - adding player in data placeholder static class
        private AddNewPlayerResponse AddPlayerToTheRoom(AddNewPlayerRequest request, bool hostPlayer)
        {
            //assign data (Property is only readable)
            (bool added, int playerNumber) = MakaoEngineHostDataPlaceholders.AddNewPlayerToTheRoom(request, hostPlayer);
            AddNewPlayerResponse response;

            if (added)
            {
                //find player with specific number
                PlayerData playerData = MakaoEngineHostDataPlaceholders.PlayersData.Single(p => p.PlayerNumber == playerNumber);

                //create response (player number = 0)
                response = new AddNewPlayerResponse()
                {
                    PlayerName           = playerData.PlayerName,
                    PlayedGames          = playerData.PlayedGames,
                    PlayedAndWonGames    = playerData.PlayedAndWonGames,
                    PlayerID             = playerData.PlayerID,
                    PlayerNumber         = playerData.PlayerNumber,
                    IsHostPlayer         = playerData.IsHostPlayer,
                    AddedToGame          = added,
                    TotalAMountOfPlayers = MakaoEngineHostDataPlaceholders.TotalAmountOfPLayers,
                };

                var logger = NLog.LogManager.GetCurrentClassLogger();
                logger.Info("Added new player to the room - player " + response.PlayerNumber.ToString());
            }
            else
            {
                //create response (player number = -1)
                response = new AddNewPlayerResponse()
                {
                    PlayerName   = "",
                    PlayedGames  = 0,
                    PlayerID     = "",
                    PlayerNumber = -1,
                    AddedToGame  = added,
                };

                var logger = NLog.LogManager.GetCurrentClassLogger();
                logger.Info("Adding new player to the room failed...");
            }

            return(response);
        }
        //with this method player sends info about the fact, that he is ready to play
        bool IMakaoGameHostService.ChangePlayerReadinessToPlay(PlayerIsReadyToPlayGameRequest request)
        {
            //try to assign the readiness status
            bool assigned = MakaoEngineHostDataPlaceholders.ChangeReadinessToPlay(request);

            if (assigned)
            {
                //after changing readiness to play of specific player, send info to clients
                //about changes in current players list
                InfoSenderClass Sender = new InfoSenderClass();
                Sender.SendInfoToClientsAboutChangeOfReadiness(ObtainPlayersReadinessData());

                //and check if all players confirmed readiness to play if yes, start
                //procedure of starting the game
                Task.Run(() => MakaoEngineHostDataPlaceholders.FireUpStartingNewGameAlgorithm(synchCont));
            }
            return(assigned);
        }
 GetRoomDetailsWhenJoiningRoomResponse IMakaoGameHostService.GetHostRoomDetails()
 {
     return(MakaoEngineHostDataPlaceholders.GetHostRoomDetails());
 }
 //method for assigning setup data to Host (including password to room)
 bool IMakaoGameHostService.AssignGameSetupData(AssignGameSetupDataRequest request)
 {
     return(MakaoEngineHostDataPlaceholders.AssignGameData(request));
 }