/// <summary> /// Finds the list of tactical maps which are used in this plot. /// </summary> /// <returns>Returns the list of IDs of maps.</returns> public List <Guid> FindTacticalMaps() { BinarySearchTree <Guid> bst = new BinarySearchTree <Guid>(); foreach (PlotPoint pp in fPoints) { if (pp.Element != null) { if (pp.Element is Encounter) { Encounter enc = pp.Element as Encounter; if ((enc.MapID != Guid.Empty) && (enc.MapAreaID != Guid.Empty)) { bst.Add(enc.MapID); } } if (pp.Element is TrapElement) { TrapElement te = pp.Element as TrapElement; if ((te.MapID != Guid.Empty) && (te.MapAreaID != Guid.Empty)) { bst.Add(te.MapID); } } if (pp.Element is SkillChallenge) { SkillChallenge sc = pp.Element as SkillChallenge; if ((sc.MapID != Guid.Empty) && (sc.MapAreaID != Guid.Empty)) { bst.Add(sc.MapID); } } if (pp.Element is MapElement) { MapElement me = pp.Element as MapElement; if (me.MapID != Guid.Empty) { bst.Add(me.MapID); } } } } List <Guid> list = bst.SortedList; list.Remove(Guid.Empty); return(list); }
/// <summary> /// Creates a copy of the TrapElement. /// </summary> /// <returns>Returns the copy.</returns> public IElement Copy() { TrapElement te = new TrapElement(); te.Trap = fTrap.Copy(); te.MapID = fMapID; te.MapAreaID = fMapAreaID; return(te); }
public IElement Copy() { TrapElement trapElement = new TrapElement() { Trap = this.fTrap.Copy(), MapID = this.fMapID, MapAreaID = this.fMapAreaID }; return(trapElement); }
public List <Guid> FindTacticalMaps() { BinarySearchTree <Guid> binarySearchTree = new BinarySearchTree <Guid>(); foreach (PlotPoint fPoint in this.fPoints) { if (fPoint.Element == null) { continue; } if (fPoint.Element is Encounter) { Encounter element = fPoint.Element as Encounter; if (element.MapID != Guid.Empty && element.MapAreaID != Guid.Empty) { binarySearchTree.Add(element.MapID); } } if (fPoint.Element is TrapElement) { TrapElement trapElement = fPoint.Element as TrapElement; if (trapElement.MapID != Guid.Empty && trapElement.MapAreaID != Guid.Empty) { binarySearchTree.Add(trapElement.MapID); } } if (fPoint.Element is SkillChallenge) { SkillChallenge skillChallenge = fPoint.Element as SkillChallenge; if (skillChallenge.MapID != Guid.Empty && skillChallenge.MapAreaID != Guid.Empty) { binarySearchTree.Add(skillChallenge.MapID); } } if (!(fPoint.Element is MapElement)) { continue; } MapElement mapElement = fPoint.Element as MapElement; if (mapElement.MapID == Guid.Empty) { continue; } binarySearchTree.Add(mapElement.MapID); } List <Guid> sortedList = binarySearchTree.SortedList; sortedList.Remove(Guid.Empty); return(sortedList); }
/// <summary> /// Gets the tactical map and map area associated with the point, if any. /// </summary> /// <param name="map">The map associated with the point.</param> /// <param name="map_area">The map area associated with the point.</param> public void GetTacticalMapArea(ref Map map, ref MapArea map_area) { Guid map_id = Guid.Empty; Guid map_area_id = Guid.Empty; Encounter enc = fElement as Encounter; if (enc != null) { map_id = enc.MapID; map_area_id = enc.MapAreaID; } SkillChallenge sc = fElement as SkillChallenge; if (sc != null) { map_id = sc.MapID; map_area_id = sc.MapAreaID; } TrapElement te = fElement as TrapElement; if (te != null) { map_id = te.MapID; map_area_id = te.MapAreaID; } MapElement me = fElement as MapElement; if (me != null) { map_id = me.MapID; map_area_id = me.MapAreaID; } if ((map_id != Guid.Empty) && (map_area_id != Guid.Empty)) { map = Session.Project.FindTacticalMap(map_id); if (map != null) { map_area = map.FindArea(map_area_id); } } }
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); } } }