Files
Project-M/Assets/_Project/Scripts/Simulation/Economy/ResourceComponents.cs
T
2026-06-03 22:41:27 -07:00

18 lines
1.0 KiB
C#

using Unity.Entities;
namespace ProjectM.Simulation
{
/// <summary>
/// Tag marking the single GLOBAL shared-resource ledger — the entity whose [GhostField]
/// <see cref="StorageEntry"/> buffer holds harvested resources (Aether/ore/biomass) replicated to ALL
/// connections. It lives on the ownerless interpolated CycleDirector ghost, which carries NO
/// <see cref="RegionTag"/>, so GhostRelevancy (SetIsIrrelevant) keeps it relevant to players in EVERY
/// region — base AND expedition — unlike the region-tagged base storage container (which relevancy hides
/// from expedition players). Server systems resolve the ledger via
/// <c>GetSingletonEntity&lt;ResourceLedger&gt;()</c> then <c>GetBuffer&lt;StorageEntry&gt;()</c> — NEVER
/// <c>GetSingleton&lt;StorageEntry&gt;</c> (the base container owns a second StorageEntry buffer, so a
/// buffer-typed singleton query would throw "multiple instances").
/// </summary>
public struct ResourceLedger : IComponentData { }
}