using Unity.Entities;
using Unity.NetCode;
namespace ProjectM.Simulation
{
///
/// One equipment slot on the player. The per-player buffer holds exactly
/// rows in fixed slot order (the buffer INDEX is the slot — Weapon=0/Armor=1/Trinket=2/Tool=3), so only the
/// equipped item id needs to replicate; there is no separate Slot field to desync. A [GhostField]
/// buffer (a / twin)
/// so the owning client's HUD can show its loadout; the server is the SOLE writer (EquipSystem).
///
/// The actual effects — AbilityRef.Id from the Weapon slot + StatModifiers per slot — are applied
/// EVENT-DRIVEN by EquipSystem (once per equip/unequip), NOT re-derived from this buffer each tick; this
/// buffer is the replicated record of WHAT is equipped (HUD-facing + persistence-ready), not the effect.
/// NOTE: adding this [GhostField] buffer changes the player ghost serialization hash → the player
/// prefab/subscene MUST be re-baked consistently in both worlds (see ).
///
[GhostComponent(OwnerSendType = SendToOwnerType.All)]
[InternalBufferCapacity(4)]
public struct EquipmentSlot : IBufferElementData
{
/// Item equipped in this slot (0 = empty). The buffer INDEX is the .
[GhostField] public ushort ItemId;
}
}