Beispiel #1
0
        public override string ToString()
        {
            var nL   = Environment.NewLine + "    ";
            var desc = ForbiddenZones.Aggregate("These system zones contain: ", (current, o) => current + (nL + "" + o));

            return(FormationZones.Aggregate(desc, (current, o) => current + (nL + "" + o)));
        }
Beispiel #2
0
        //gets the range for this
        public Range GetRange(double orbit)
        {
            foreach (var o in FormationZones.Where(o => o.WithinRange(orbit)))
            {
                return(new Range(o.LowerBound, o.UpperBound));
            }

            foreach (var o in ForbiddenZones.Where(o => o.WithinRange(orbit)))
            {
                return(new Range(o.LowerBound, o.UpperBound));
            }

            return(new Range(0, 0));
        }
Beispiel #3
0
 public void CreateForbiddenZone(ForbiddenZone incoming)
 {
     ForbiddenZones.Add(new ForbiddenZone(incoming));
 }
Beispiel #4
0
 //sorting functions
 public void SortForbiddenZones()
 {
     ForbiddenZones.Sort((x, y) => x.LowerBound.CompareTo(y.LowerBound));
 }
Beispiel #5
0
 public void CreateForbiddenZone(Range forbiddenRange, int primary, int secondary)
 {
     ForbiddenZones.Add(new ForbiddenZone(forbiddenRange, primary, secondary));
 }
Beispiel #6
0
 //create functions
 public void CreateForbiddenZone(double lower, double upper, int primary, int secondary)
 {
     ForbiddenZones.Add(new ForbiddenZone(lower, upper, primary, secondary));
 }
Beispiel #7
0
 //check within range functions.
 public bool IsWithinForbiddenZone(double orbit)
 {
     return(ForbiddenZones.Any(o => o.WithinRange(orbit)));
 }