public bool IsCompleted(String map) { bool d; CompletedMaps.TryGetValue(map, out d); return(d); }
void StopPlayingMap(ProgramEvents.StopPlayingMap e) { int prevSilver = GetMaxSilverYield(e.MapFileName); GameInstances.Add(e); if (e.GameState == Client.Game.GameState.Won && CurrentMap != null) { if (!Program.Settings.DeveloperMainMenu) { if (e.SilverYield > prevSilver) { SilverCoins += e.SilverYield - prevSilver; } bool d; if (!CompletedMaps.TryGetValue(CurrentMap.MapName, out d)) { d = false; } CompletedMaps[CurrentMap.MapName] = true; int ge = 0; if (!d) { ge = CurrentMap.Yield; GoldCoins += CurrentMap.Yield; } Save(); if (!d) { Program.Instance.SignalEvent(new ProgramEvents.CompletedMap { MapName = CurrentMap.MapName, GoldEarned = ge }); } } } CurrentMap = null; currentMapFileName = null; }