コード例 #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);
        }
コード例 #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;
            }
        }
コード例 #3
0
 public SystemDistance(JourneySystem first, JourneySystem second)
 {
     First    = first;
     Second   = second;
     Distance = first.Coords.Distance(second.Coords);
 }