Core Game Loop Additions

This commit is contained in:
2026-06-03 22:41:27 -07:00
parent 79ff06a7df
commit 8e9b4412ce
70 changed files with 3084 additions and 2 deletions
@@ -0,0 +1,41 @@
using Unity.Entities;
using Unity.NetCode;
namespace ProjectM.Simulation
{
/// <summary>Resource-type ids for harvested materials (a byte, not an enum, per the cross-assembly enum-in-Burst hazard).</summary>
public static class ResourceId
{
/// <summary>Unused / empty sentinel (aligns with StorageMath's 0-itemId no-op).</summary>
public const byte None = 0;
/// <summary>Magic energy — powers abilities / charging.</summary>
public const byte Aether = 1;
/// <summary>Raw ore — structures / building.</summary>
public const byte Ore = 2;
/// <summary>Biomass — misc / crafting.</summary>
public const byte Biomass = 3;
}
/// <summary>
/// A harvestable resource node in the procedural expedition field — an ownerless INTERPOLATED ghost
/// (region-tagged Expedition) that clients see and shoot. The server-only ResourceHarvestSystem sweeps
/// projectiles against it; each hit deposits <see cref="HarvestPerHit"/> of <see cref="ResourceId"/> into
/// the GLOBAL resource ledger and decrements <see cref="Remaining"/>; the node despawns at &lt;= 0.
/// ResourceId/Remaining are [GhostField] so clients can tint by type and (later) show depletion;
/// HarvestPerHit is baked, server-only.
/// </summary>
public struct ResourceNode : IComponentData
{
/// <summary>Which resource this node yields (see <see cref="ResourceId"/>).</summary>
[GhostField] public byte ResourceId;
/// <summary>Remaining resource units; the node despawns when this reaches 0.</summary>
[GhostField] public int Remaining;
/// <summary>Units yielded per projectile hit (baked; server-only).</summary>
public float HarvestPerHit;
}
}