Added dynamic spawning and despawning of objects

This commit is contained in:
Aslan 2026-01-27 07:08:03 -05:00
parent adbb208436
commit e0cf8d9755
23 changed files with 794 additions and 350 deletions

View file

@ -1,3 +1,4 @@
using System;
using Godot;
public class Universe
@ -23,4 +24,22 @@ public class Universe
{
return Sectors[x, y, z];
}
public void ForEachSector(Action<Sector> action)
{
int sizeX = Sectors.GetLength(0);
int sizeY = Sectors.GetLength(1);
int sizeZ = Sectors.GetLength(2);
for (int x = 0; x < sizeX; x++)
{
for (int y = 0; y < sizeY; y++)
{
for (int z = 0; z < sizeZ; z++)
{
action(Sectors[x, y, z]);
}
}
}
}
}