Basic universe management, generation and simulation flow
This commit is contained in:
parent
4c078dbede
commit
78fceeb95e
29 changed files with 664 additions and 29 deletions
37
scripts/Sector.cs
Normal file
37
scripts/Sector.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue