Pow3r goes brrr with generational IDs.

This commit is contained in:
Pieter-Jan Briers
2021-07-31 02:50:11 +02:00
parent b92a2ba115
commit 73e4946e27
5 changed files with 310 additions and 78 deletions

View File

@@ -10,7 +10,6 @@ namespace Pow3r
{
private const int MaxTickData = 180;
private int _nextId = 1;
private PowerState _state = new();
private Network _linking;
private int _tickDataIdx;
@@ -33,11 +32,6 @@ namespace Pow3r
private readonly Queue<object> _remQueue = new();
private readonly Stopwatch _simStopwatch = new Stopwatch();
private NodeId AllocId()
{
return new(_nextId++);
}
private void Tick(float frameTime)
{
if (_paused)