public IVolume NewPlan() { IVolume output = new VolumeRuntime(); output.SetBuilding(this); return(output); }
public int IndexOf(IVolume plan) { VolumeRuntime newVolume = plan as VolumeRuntime; if (newVolume == null) { throw new NullReferenceException("Runtime Building Not Using Right Volume Type"); } return(_volumes.IndexOf(newVolume)); }
public IVolume Clone() { VolumeRuntime output = new VolumeRuntime(); List <VolumePoint> newPoints = new List <VolumePoint>(); foreach (VolumePoint point in _points) { newPoints.Add(point.Clone()); } output.Initialise(newPoints, 1, _floorHeight); output.name = name + "_copy"; output.baseHeight = _baseHeight + _floorHeight; return(output); }
public IVolume AddPlan(IVolume newPlan, IVolume abovePlan = null) { VolumeRuntime newVolume = newPlan as VolumeRuntime; if (newVolume == null) { throw new NullReferenceException("Runtime Building Not Using Right Volume Type"); } _volumes.Add(newVolume); if (abovePlan != null) { abovePlan.AddAbovePlan(newPlan); abovePlan.HeightModified(abovePlan); } return(newPlan); }
public void RemovePlan(IVolume plan) { VolumeRuntime newVolume = plan as VolumeRuntime; if (newVolume == null) { throw new NullReferenceException("Runtime Building Not Using Right Volume Type"); } _volumes.Remove(newVolume); List <IVolume> childPlans = new List <IVolume>(plan.AbovePlanList()); int childPlanCount = childPlans.Count; for (int cp = 0; cp < childPlanCount; cp++) { RemovePlan(plan.AbovePlanList()[cp]); } }