Example #1
0
 public MapAreaSelectForm(Guid map_id, Guid map_area_id)
 {
     this.InitializeComponent();
     Application.Idle       += new EventHandler(this.Application_Idle);
     this.UseTileBtn.Visible = this.map_tiles_exist();
     this.MapBox.Items.Add("(no map)");
     foreach (Masterplan.Data.Map map in Session.Project.Maps)
     {
         this.MapBox.Items.Add(map);
     }
     Masterplan.Data.Map map1 = Session.Project.FindTacticalMap(map_id);
     if (map1 == null)
     {
         this.MapBox.SelectedIndex = 0;
         this.AreaBox.Items.Add("(no map)");
         this.AreaBox.SelectedIndex = 0;
         return;
     }
     this.MapBox.SelectedItem = map1;
     Masterplan.Data.MapArea mapArea = map1.FindArea(map_area_id);
     if (mapArea != null)
     {
         this.AreaBox.SelectedItem = mapArea;
         return;
     }
     this.AreaBox.SelectedIndex = 0;
 }
Example #2
0
 private void show_map()
 {
     Masterplan.Data.Map selectedItem = this.MapBox.SelectedItem as Masterplan.Data.Map;
     if (selectedItem == null)
     {
         this.MapView.Map = null;
         return;
     }
     this.MapView.Map = selectedItem;
     Masterplan.Data.MapArea mapArea = this.AreaBox.SelectedItem as Masterplan.Data.MapArea;
     if (mapArea == null)
     {
         this.MapView.Viewpoint = Rectangle.Empty;
         return;
     }
     this.MapView.Viewpoint = mapArea.Region;
 }
Example #3
0
        public void GetTacticalMapArea(ref Map map, ref MapArea map_area)
        {
            Guid      empty     = Guid.Empty;
            Guid      mapAreaID = Guid.Empty;
            Encounter encounter = this.fElement as Encounter;

            if (encounter != null)
            {
                empty     = encounter.MapID;
                mapAreaID = encounter.MapAreaID;
            }
            SkillChallenge skillChallenge = this.fElement as SkillChallenge;

            if (skillChallenge != null)
            {
                empty     = skillChallenge.MapID;
                mapAreaID = skillChallenge.MapAreaID;
            }
            TrapElement trapElement = this.fElement as TrapElement;

            if (trapElement != null)
            {
                empty     = trapElement.MapID;
                mapAreaID = trapElement.MapAreaID;
            }
            MapElement mapElement = this.fElement as MapElement;

            if (mapElement != null)
            {
                empty     = mapElement.MapID;
                mapAreaID = mapElement.MapAreaID;
            }
            if (empty != Guid.Empty && mapAreaID != Guid.Empty)
            {
                map = Session.Project.FindTacticalMap(empty);
                if (map != null)
                {
                    map_area = map.FindArea(mapAreaID);
                }
            }
        }
Example #4
0
        public MapArea FindArea(Guid area_id)
        {
            MapArea mapArea;

            List <MapArea> .Enumerator enumerator = this.fAreas.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    MapArea current = enumerator.Current;
                    if (current.ID != area_id)
                    {
                        continue;
                    }
                    mapArea = current;
                    return(mapArea);
                }
                return(null);
            }
            finally
            {
                ((IDisposable)enumerator).Dispose();
            }
        }
Example #5
0
 public MapAreaEventArgs(Masterplan.Data.MapArea area)
 {
     this.fArea = area;
 }