mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
syntax
This commit is contained in:
parent
7cb6170a50
commit
6395b9e637
@ -12,8 +12,13 @@ public static class HistoryBounds
|
|||||||
{
|
{
|
||||||
// insert current bounds into history. returns new total bounds.
|
// insert current bounds into history. returns new total bounds.
|
||||||
// Queue.Dequeue() always has the oldest bounds.
|
// Queue.Dequeue() always has the oldest bounds.
|
||||||
public static Bounds Insert(Queue<Bounds> history, int limit, Bounds bounds)
|
public static Bounds Insert(
|
||||||
|
Queue<Bounds> history,
|
||||||
|
int limit,
|
||||||
|
Bounds bounds)
|
||||||
{
|
{
|
||||||
|
// optimization: only insert if
|
||||||
|
|
||||||
// remove oldest if limit reached
|
// remove oldest if limit reached
|
||||||
if (history.Count >= limit)
|
if (history.Count >= limit)
|
||||||
history.Dequeue();
|
history.Dequeue();
|
||||||
@ -31,15 +36,5 @@ public static Bounds Insert(Queue<Bounds> history, int limit, Bounds bounds)
|
|||||||
|
|
||||||
return total;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// TODO .bounds that wraps past N bounds
|
|
||||||
// TODO fast data structure to always .encapsulate latest and .remove oldest
|
|
||||||
|
|
||||||
// TODO update:
|
|
||||||
// - capture bounds every few seconds
|
|
||||||
// - build new totalBounds only when capturing, not every .totalBounds call
|
|
||||||
|
|
||||||
// TODO runtime debug gizmo
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user