private static void GetBuffer(ISimGameWorldReadWriteAccessor accessor, Entity?sourceOrDestination, out DynamicBuffer <InventoryItemReference>?buffer) { buffer = accessor.HasComponent <InventoryItemReference>(sourceOrDestination.GetValueOrDefault()) ? (DynamicBuffer <InventoryItemReference>?)accessor.GetBuffer <InventoryItemReference>(sourceOrDestination.Value) : null; }