28 lines
1.2 KiB
C#
28 lines
1.2 KiB
C#
using Unity.Entities;
|
|
using Unity.Mathematics;
|
|
|
|
namespace ProjectM.Simulation
|
|
{
|
|
/// <summary>
|
|
/// Singleton baked into the gameplay subscene describing the shared home base: a fixed anchor
|
|
/// position and the planar build-grid coordinate space (origin + cell size + extent) that M6 build
|
|
/// placement snaps structures into and M7 production chains tick inside. Flat and blittable (no
|
|
/// entity refs) so it stays deterministic across both worlds and serialization-friendly for later
|
|
/// persistence. Present identically on client and server (baked, not replicated).
|
|
/// </summary>
|
|
public struct BaseAnchor : IComponentData
|
|
{
|
|
/// <summary>World-space center of the plot; also the player spawn-ring center. Equals BaseGridMath.PlotCenter(this).</summary>
|
|
public float3 AnchorPos;
|
|
|
|
/// <summary>World-space min-XZ CORNER of cell (0,0). Y is the base plane. Baked = AnchorPos - (GridDims*CellSize)/2 on XZ.</summary>
|
|
public float3 GridOrigin;
|
|
|
|
/// <summary>Size of one square grid cell in world units.</summary>
|
|
public float CellSize;
|
|
|
|
/// <summary>Grid extent in cells along X and Z; valid cell indices are [0, GridDims).</summary>
|
|
public int2 GridDims;
|
|
}
|
|
}
|