예제 #1
0
        public bool TryRemoveConstructedTeamFaction(int constructedTeamId, int factionId)
        {
            if (!ConstructedTeamsMap.TryRemove(GetConstructedTeamFactionKey(constructedTeamId, factionId), out var teamOut))
            {
                return(false);
            }

            ConstructedTeamsMatchInfo.RemoveAll(ctmi => ctmi.ConstructedTeam.Id == constructedTeamId && ctmi.ActiveFactionId == factionId);

            return(true);
        }
예제 #2
0
        public bool TryAddConstructedTeamFaction(ConstructedTeamMatchInfo matchInfo)
        {
            var constructedTeam = matchInfo.ConstructedTeam;
            var factionId       = matchInfo.ActiveFactionId;

            if (!ConstructedTeamsMap.TryAdd(GetConstructedTeamFactionKey(constructedTeam.Id, factionId), matchInfo))
            {
                return(false);
            }

            ConstructedTeamsMatchInfo.Add(matchInfo);

            return(true);
        }