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); }
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); }