Run Re-Do
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
using Unity.Entities;
|
||||
using Unity.NetCode;
|
||||
|
||||
namespace ProjectM.Simulation
|
||||
{
|
||||
/// <summary>
|
||||
/// One owned permanent meta-upgrade tier, keyed by (class, upgrade). The CycleDirector's DynamicBuffer of these is
|
||||
/// the authoritative per-class meta-progression record. A GLOBAL <c>[GhostField]</c> buffer on the ownerless
|
||||
/// interpolated director ghost (no OwnerSendType — the party invests together and every client reads it for the
|
||||
/// shop), mirroring <see cref="StorageEntry"/>. Persisted to disk (SaveData v6) and re-applied born-correct at
|
||||
/// player spawn as meta-band <see cref="StatModifier"/>s. Bytes only (Burst/serialization safe). Sparse — an
|
||||
/// absent (class, upgrade) row means tier 0.
|
||||
/// </summary>
|
||||
[InternalBufferCapacity(24)]
|
||||
public struct MetaTierState : IBufferElementData
|
||||
{
|
||||
/// <summary>Owning class id (Warrior/Ranger — the CharacterId anchor).</summary>
|
||||
[GhostField] public byte ClassId;
|
||||
/// <summary>Upgrade id (append-only key into the meta catalog).</summary>
|
||||
[GhostField] public byte UpgradeId;
|
||||
/// <summary>Owned tier (>=1; an absent row = 0).</summary>
|
||||
[GhostField] public byte Tier;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Server-only singleton on the CycleDirector: the FIRST-COMMIT latch for the co-op route choice. Written IN-PLACE
|
||||
/// (immediate SystemAPI.SetComponent, not a deferred ECB) inside <c>RouteSelectSystem</c>'s drain loop so two
|
||||
/// same-tick picks cannot both observe <see cref="HasPick"/>==0 (the DR-014 atomicity idiom). NOT replicated.
|
||||
/// </summary>
|
||||
public struct RouteCommand : IComponentData
|
||||
{
|
||||
/// <summary>1 once a route has been committed for the current (RunEpoch, layer).</summary>
|
||||
public byte HasPick;
|
||||
/// <summary>The committed option index (into the replicated RouteOpt* set).</summary>
|
||||
public byte OptionIndex;
|
||||
/// <summary>Run epoch the pick is for (stale-reject guard).</summary>
|
||||
public int ForRunEpoch;
|
||||
/// <summary>Layer the pick is for (stale-reject guard).</summary>
|
||||
public int ForLayer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Server-only persisted meta counters on the CycleDirector (mirrored to the replicated <see cref="RunInfo"/> for
|
||||
/// the HUD). Added UNCONDITIONALLY at director spawn (like CycleRuntime/ThreatState/RunPhase) so a New-Game boot
|
||||
/// has the component the bank block reads; restored values are SetComponent'd only inside the save-present block.
|
||||
/// NOT replicated.
|
||||
/// </summary>
|
||||
public struct MetaCounters : IComponentData
|
||||
{
|
||||
public int RunsCompleted;
|
||||
public int MaxDepthReached;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Server-only tag of a player's class id, added at spawn by <c>GoInGameServerSystem</c>. Lets the meta systems
|
||||
/// resolve which per-class tier record to seed / spend against (class was previously only an <c>AbilityRef</c> /
|
||||
/// wire concern). NOT replicated.
|
||||
/// </summary>
|
||||
public struct PlayerClass : IComponentData
|
||||
{
|
||||
public byte ClassId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user