Beispiel #1
0
        private void AddToBucket(JourneySystem system, CoordF sysCoord, Dictionary <CoordF, SystemBucket> buckets)
        {
            var bucketCoord = new CoordF(
                (int)(sysCoord.X / _bucketSize),
                (int)(sysCoord.Y / _bucketSize),
                (int)(sysCoord.Z / _bucketSize)
                );
            var bucket = buckets.TryGetValue(bucketCoord, out var b)
                ? b
                : buckets[bucketCoord] = new SystemBucket();

            bucket.Add(system);
        }
Beispiel #2
0
        private IEnumerable <SystemDetails> MaterializeJourney(JourneySystem start)
        {
            var last = start.Details;

            last.PlottedDistance = last.Ref.Distance;
            yield return(last);

            foreach (var journeySystem in start.Traverse().SkipLast(1))
            {
                var current = journeySystem.Details;
                current.PlottedDistance = (decimal)current.Ref.Coords.Distance(last.Ref.Coords);
                yield return(current);

                last = current;
            }
        }
Beispiel #3
0
 public SystemDistance(JourneySystem first, JourneySystem second)
 {
     First    = first;
     Second   = second;
     Distance = first.Coords.Distance(second.Coords);
 }