public static void DisbandedMatch(int id) { if (MatchSetup.Match != null && MatchSetup.Match.matchId == id) { MatchSetup.MatchDisbanded(); } lock (Matches) { List <Match> found = Matches.FindAll(m => m.matchInfo.matchId == id); foreach (Match m in found) { if (m.SpriteCollection != null) { foreach (pSprite p in m.SpriteCollection) { p.FadeOut(50); p.AlwaysDraw = false; } } lock (Matches) Matches.Remove(m); } } LobbyUpdatePending = true; }
public static void IncomingMatch(bMatch match) { if (MatchSetup.Match != null && MatchSetup.Match.matchId == match.matchId) { MatchSetup.IncomingMatch(match); } lock (Matches) { int found = Matches.FindIndex(m => m.matchInfo.matchId == match.matchId); if (found < 0) { Matches.Add(new Match(match)); } else { Matches[found].matchInfo = match; } } LobbyUpdatePending = true; }