24 lines
1000 B
C#
24 lines
1000 B
C#
using Unity.Entities;
|
|
using Unity.NetCode;
|
|
|
|
namespace ProjectM.Simulation
|
|
{
|
|
/// <summary>
|
|
/// One (item, count) row in a shared storage container's contents. The container's DynamicBuffer of
|
|
/// these is the server-authoritative shared inventory; it is a GhostField buffer so the server's
|
|
/// mutations replicate to every client. The container is an ownerless INTERPOLATED ghost, so no
|
|
/// OwnerSendType / GhostOwner applies (those are for owner-predicted ghosts like the player).
|
|
/// ItemId is an opaque id; a richer item model (and the M7 machine input/output generalisation)
|
|
/// layers on top without changing replication.
|
|
/// </summary>
|
|
[InternalBufferCapacity(16)]
|
|
public struct StorageEntry : IBufferElementData
|
|
{
|
|
/// <summary>Opaque item identifier (0 = empty/unused).</summary>
|
|
[GhostField] public ushort ItemId;
|
|
|
|
/// <summary>Quantity of this item in the container.</summary>
|
|
[GhostField] public int Count;
|
|
}
|
|
}
|