/// <summary> /// Creates a copy of the point. /// </summary> /// <returns>Returns the copy.</returns> public PlotPoint Copy() { PlotPoint pp = new PlotPoint(); pp.ID = fID; pp.Name = fName; pp.State = fState; pp.Colour = fColour; pp.Details = fDetails; pp.ReadAloud = fReadAloud; pp.Links.AddRange(fLinks); pp.Subplot = fSubplot.Copy(); pp.Element = (fElement != null) ? fElement.Copy() : null; pp.Date = (fDate != null) ? fDate.Copy() : null; pp.RegionalMapID = fRegionalMapID; pp.MapLocationID = fMapLocationID; pp.AdditionalXP = fAdditionalXP; foreach (Parcel parcel in fParcels) { pp.Parcels.Add(parcel.Copy()); } foreach (Guid entry_id in fEncyclopediaEntries) { pp.EncyclopediaEntryIDs.Add(entry_id); } return(pp); }
/// <summary> /// Removes the specified plot point, and all references to it. /// </summary> /// <param name="point">The plot point.</param> public void RemovePoint(PlotPoint point) { List <Guid> links_to = new List <Guid>(); foreach (PlotPoint pp in fPoints) { if (pp.Links.Contains(point.ID)) { // Remove the reference to this point while (pp.Links.Contains(point.ID)) { pp.Links.Remove(point.ID); } // Link this to all points on the other side foreach (Guid point_id in point.Links) { if (pp.Links.Contains(point_id)) { continue; } pp.Links.Add(point_id); } } } fPoints.Remove(point); }
public bool DrawDelve(PlotPoint pp, Map map) { bool flag; List <MapArea> .Enumerator enumerator = map.Areas.GetEnumerator(); try { while (enumerator.MoveNext()) { MapArea current = enumerator.Current; Encounter encounter = new Encounter(); if (this.DrawEncounter(encounter)) { PlotPoint plotPoint = new PlotPoint(current.Name) { Element = encounter }; pp.Subplot.Points.Add(plotPoint); } else { flag = false; return(flag); } } return(true); } finally { ((IDisposable)enumerator).Dispose(); } }
public void RemovePoint(PlotPoint point) { List <Guid> guids = new List <Guid>(); foreach (PlotPoint fPoint in this.fPoints) { if (!fPoint.Links.Contains(point.ID)) { continue; } while (fPoint.Links.Contains(point.ID)) { fPoint.Links.Remove(point.ID); } foreach (Guid link in point.Links) { if (fPoint.Links.Contains(link)) { continue; } fPoint.Links.Add(link); } } this.fPoints.Remove(point); }
public PlotPoint FindPointForMapArea(Map map, MapArea area) { PlotPoint plotPoint; List <PlotPoint> .Enumerator enumerator = this.fPoints.GetEnumerator(); try { while (enumerator.MoveNext()) { PlotPoint current = enumerator.Current; Map map1 = null; MapArea mapArea = null; current.GetTacticalMapArea(ref map1, ref mapArea); if (map1 != map || mapArea != area) { continue; } plotPoint = current; return(plotPoint); } return(null); } finally { ((IDisposable)enumerator).Dispose(); } }
public List <PlotPoint> FindSubtree(PlotPoint pp) { List <PlotPoint> plotPoints = new List <PlotPoint>() { pp }; foreach (Guid link in pp.Links) { plotPoints.AddRange(this.FindSubtree(this.FindPoint(link))); } return(plotPoints); }
public PlotPoint Copy() { IElement element; CalendarDate calendarDate; PlotPoint plotPoint = new PlotPoint() { ID = this.fID, Name = this.fName, State = this.fState, Colour = this.fColour, Details = this.fDetails, ReadAloud = this.fReadAloud }; plotPoint.Links.AddRange(this.fLinks); plotPoint.Subplot = this.fSubplot.Copy(); PlotPoint plotPoint1 = plotPoint; if (this.fElement != null) { element = this.fElement.Copy(); } else { element = null; } plotPoint1.Element = element; PlotPoint plotPoint2 = plotPoint; if (this.fDate != null) { calendarDate = this.fDate.Copy(); } else { calendarDate = null; } plotPoint2.Date = calendarDate; plotPoint.RegionalMapID = this.fRegionalMapID; plotPoint.MapLocationID = this.fMapLocationID; plotPoint.AdditionalXP = this.fAdditionalXP; foreach (Parcel fParcel in this.fParcels) { plotPoint.Parcels.Add(fParcel.Copy()); } foreach (Guid fEncyclopediaEntry in this.fEncyclopediaEntries) { plotPoint.EncyclopediaEntryIDs.Add(fEncyclopediaEntry); } return(plotPoint); }
/// <summary> /// Find all points in this plot which lead from the point with the specified ID. /// </summary> /// <param name="pp">The ID of the plot point.</param> /// <returns>Returns the list of points.</returns> public List <PlotPoint> FindSubtree(PlotPoint pp) { List <PlotPoint> subtree = new List <PlotPoint>(); subtree.Add(pp); foreach (Guid id in pp.Links) { PlotPoint child = FindPoint(id); List <PlotPoint> branch = FindSubtree(child); subtree.AddRange(branch); } return(subtree); }
/// <summary> /// Draws cards from the deck to create a delve. /// </summary> /// <param name="pp">The plot point to use as the parent plot.</param> /// <param name="map">The map to create the delve for.</param> /// <returns>Returns true if the process succeeded; false otherwise.</returns> public bool DrawDelve(PlotPoint pp, Map map) { foreach (MapArea area in map.Areas) { Encounter enc = new Encounter(); bool ok = DrawEncounter(enc); if (!ok) { return(false); } PlotPoint enc_point = new PlotPoint(area.Name); enc_point.Element = enc; pp.Subplot.Points.Add(enc_point); } return(true); }
public PlotPoint FindPoint(Guid id) { PlotPoint plotPoint; List <PlotPoint> .Enumerator enumerator = this.fPoints.GetEnumerator(); try { while (enumerator.MoveNext()) { PlotPoint current = enumerator.Current; if (current.ID != id) { continue; } plotPoint = current; return(plotPoint); } return(null); } finally { ((IDisposable)enumerator).Dispose(); } }
public CreatureIssue(PlotPoint point) { this.fPoint = point; }
public DifficultyIssue(PlotPoint point) { this.fPoint = point; }
public ParcelIssue(Parcel parcel, PlotPoint pp) { this.fParcel = parcel; this.fPoint = pp; }
/// <summary> /// Constructor. /// </summary> /// <param name="parcel">The treasure parcel.</param> /// <param name="pp">The plot point.</param> public ParcelIssue(Parcel parcel, PlotPoint pp) { fParcel = parcel; fPoint = pp; }
/// <summary> /// Constructor. /// </summary> /// <param name="point">The plot point.</param> public SkillIssue(PlotPoint point) { fPoint = point; }
public SkillIssue(PlotPoint point) { this.fPoint = point; }