Пример #1
0
        public IVolume NewPlan()
        {
            IVolume output = new VolumeRuntime();

            output.SetBuilding(this);
            return(output);
        }
Пример #2
0
        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));
        }
Пример #3
0
        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);
        }
Пример #4
0
        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);
        }
Пример #5
0
        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]);
            }
        }