@Override
    public PlayerLeftGameMessage LeaveGame(int playerID) {
        Player player = _state.GetPlayer(playerID);
        ServerGame game = _state.TryGetGameByPlayerId(playerID);

        if (game == null)
            return MessageCreator.CreatePlayerLeftGameMessage(Arrays.asList(playerID),null,player,null);

        game.RemovePlayer(player);

        if (game.CurrentGameStatus == GameStatus.Finished)
            _state.RemoveGame(game);

        List<Integer> idsToUpdate = new LinkedList<>(game.GetPlayerIds());

        List<MapChange> map = null;
        if ((game.CurrentGameStatus != GameStatus.Finished && game.CurrentGameStatus != GameStatus.WaitingForPlayer))
            map = game.GetMap();

        if (game.CurrentGameStatus == GameStatus.WaitingForPlayer || (game.CurrentGameStatus == GameStatus.Finished && !game.HasStarted))
            idsToUpdate.addAll(_state.Lobby.GetPlayerIDs());

        return MessageCreator.CreatePlayerLeftGameMessage(idsToUpdate, game, player, map);
    }