示例#1
0
        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));
            }
        }
示例#2
0
 public MapManagerEventArgs(Map last, Map next)
 {
     Last = last;
     Next = next;
 }
示例#3
0
        public void RemoveMap(Map map)
        {
            maps.Remove(map);

            if (ReferenceEquals(map, Active))
            {
                Active = null;
            }
        }