Exemplo n.º 1
0
        public bool TryRemovePlayer(string characterId)
        {
            //if (!ContainsPlayer(characterId))
            //{
            //    return false;
            //}

            //var player = Players.FirstOrDefault(p => p.Id == characterId);
            if (!PlayersMap.TryRemove(characterId, out var player))
            {
                return(false);
            }

            //Players.RemoveAll(p => p.Id == characterId);
            Players.Remove(player);

            //_playerIds.RemoveAll(id => id == characterId);
            //PlayersMap.TryRemove(characterId, out var playerOut);

            //ParticipatingPlayers.RemoveAll(p => p.Id == characterId);
            ParticipatingPlayers.Remove(player);

            ParticipatingPlayersMap.TryRemove(player.Id, out Player removedPlayer);

            //EventAggregateTracker.SubtractFromHistory(player.EventAggregateTracker);
            RemovePlayerObjectiveTicksFromTeamAggregate(player); // TODO: remove this when Objective Ticks are saved to DB

            return(true);
        }
Exemplo n.º 2
0
        public bool TryRemovePlayer(string characterId)
        {
            if (!PlayersMap.TryRemove(characterId, out var player))
            {
                return(false);
            }

            Players.Remove(player);

            ParticipatingPlayers.Remove(player);

            ParticipatingPlayersMap.TryRemove(player.Id, out Player removedPlayer);

            RemovePlayerObjectiveTicksFromTeamAggregate(player); // TODO: remove this when Objective Ticks are saved to DB

            return(true);
        }