37 lines
827 B
C#
37 lines
827 B
C#
using System.Threading;
|
|
using Godot;
|
|
|
|
public class Sector
|
|
{
|
|
public Vector3I Coordinates;
|
|
public Vector3Dec GlobalStartCoordinates;
|
|
public Vector3Dec GlobalEndCoordinates;
|
|
public Vector3 Size;
|
|
|
|
public FastUniqueList<GameObject> GameObjects = new();
|
|
|
|
public Sector(Vector3I coordinates, Vector3 size)
|
|
{
|
|
Coordinates = coordinates;
|
|
|
|
decimal startX = Coordinates.X * (decimal)size.X;
|
|
decimal startY = Coordinates.Y * (decimal)size.Y;
|
|
decimal startZ = Coordinates.Z * (decimal)size.Z;
|
|
|
|
GlobalStartCoordinates = new(startX, startY, startZ);
|
|
|
|
Size = size;
|
|
}
|
|
|
|
public Sector(int x, int y, int z, Vector3 size) : this(new(x, y, z), size) { }
|
|
|
|
public void Simulate(double delta)
|
|
{
|
|
//GD.Print(Thread.CurrentThread.ManagedThreadId);
|
|
|
|
GameObjects.ForEach(gameObject =>
|
|
{
|
|
gameObject.Simulate(delta);
|
|
});
|
|
}
|
|
}
|