mirror of
https://github.com/oliverbooth/VpSharp
synced 2024-11-23 00:18:46 +00:00
Query by order of closest to center outward
This commit is contained in:
parent
11d8d23339
commit
b7e43666b5
@ -65,12 +65,9 @@ public sealed partial class VirtualParadiseClient
|
|||||||
hashSet.Add(new Cell(x, z));
|
hashSet.Add(new Cell(x, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var centerPosition = center.ToVector3d();
|
||||||
var cells = new List<Cell>(hashSet);
|
var cells = new List<Cell>(hashSet);
|
||||||
cells.Sort((a, b) =>
|
cells.Sort((a, b) => Vector3d.DistanceSquared(a.ToVector3d(), centerPosition).CompareTo(Vector3d.Distance(b.ToVector3d(), centerPosition)));
|
||||||
{
|
|
||||||
int x = a.X.CompareTo(b.X);
|
|
||||||
return x == 0 ? a.Z.CompareTo(b.Z) : x;
|
|
||||||
});
|
|
||||||
|
|
||||||
var objects = new List<VirtualParadiseObject>();
|
var objects = new List<VirtualParadiseObject>();
|
||||||
var tasks = new List<Task>();
|
var tasks = new List<Task>();
|
||||||
|
Loading…
Reference in New Issue
Block a user