void Repository_OnObjectUpdate(IdObject idObject) { if (idObject.Equals(match)) { UpdateMatchInfo(idObject as MatchObject); return; } if (idObject.SpaceType.Equals(SpaceType.Game)) { var game = idObject as GameObject; if (!game.Match.Equals(match.Id)) { // not my game return; } if (completedGames.ContainsKey(game.Id)) { // game is completed before completedGames[game.Id].UpdateGameInfo(game); return; } if (!currentGame.IsNull() && currentGame.Id.Equals(game.Id)) { // game is current return; } // new game in this match NewGame(game).CheckState(); } }