using Unity.Entities; using Unity.Mathematics; namespace ProjectM.Simulation { /// /// 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). /// public struct BaseAnchor : IComponentData { /// World-space center of the plot; also the player spawn-ring center. Equals BaseGridMath.PlotCenter(this). public float3 AnchorPos; /// World-space min-XZ CORNER of cell (0,0). Y is the base plane. Baked = AnchorPos - (GridDims*CellSize)/2 on XZ. public float3 GridOrigin; /// Size of one square grid cell in world units. public float CellSize; /// Grid extent in cells along X and Z; valid cell indices are [0, GridDims). public int2 GridDims; } }