public void ChangeMap(string name) { Map last = Active; Map map = maps.FirstOrDefault( m => m.Name == name); if (map == null) { map = new Map(name); map.Load(); Active = map; maps.Add(map); } else { Active = map; } if (OnMapChanged != null) { OnMapChanged(this, new MapManagerEventArgs(last, Active)); } }
public MapManagerEventArgs(Map last, Map next) { Last = last; Next = next; }
public void RemoveMap(Map map) { maps.Remove(map); if (ReferenceEquals(map, Active)) { Active = null; } }