Show / Hide Table of Contents

Class InventorySystem

Inheritance
System.Object
InventorySystem
ClientInventorySystem
ServerInventorySystem
Namespace: Content.Shared.Inventory
Assembly: Content.Shared.dll
Syntax
public abstract class InventorySystem : EntitySystem

Methods

| Improve this Doc View Source

CanAccess(EntityUid, EntityUid, EntityUid)

Declaration
public bool CanAccess(EntityUid actor, EntityUid target, EntityUid itemUid)
Parameters
Type Name Description
EntityUid actor
EntityUid target
EntityUid itemUid
Returns
Type Description
System.Boolean
| Improve this Doc View Source

CanEquip(EntityUid, EntityUid, EntityUid, String, out Nullable<String>, SlotDefinition, InventoryComponent, ClothingComponent, ItemComponent)

Declaration
public bool CanEquip(EntityUid actor, EntityUid target, EntityUid itemUid, string slot, out string? reason, SlotDefinition slotDefinition = null, InventoryComponent inventory = null, ClothingComponent clothing = null, ItemComponent item = null)
Parameters
Type Name Description
EntityUid actor
EntityUid target
EntityUid itemUid
System.String slot
System.Nullable<System.String> reason
SlotDefinition slotDefinition
InventoryComponent inventory
ClothingComponent clothing
ItemComponent item
Returns
Type Description
System.Boolean
| Improve this Doc View Source

CanEquip(EntityUid, EntityUid, String, out Nullable<String>, SlotDefinition, InventoryComponent, ClothingComponent, ItemComponent)

Declaration
public bool CanEquip(EntityUid uid, EntityUid itemUid, string slot, out string? reason, SlotDefinition slotDefinition = null, InventoryComponent inventory = null, ClothingComponent clothing = null, ItemComponent item = null)
Parameters
Type Name Description
EntityUid uid
EntityUid itemUid
System.String slot
System.Nullable<System.String> reason
SlotDefinition slotDefinition
InventoryComponent inventory
ClothingComponent clothing
ItemComponent item
Returns
Type Description
System.Boolean
| Improve this Doc View Source

CanUnequip(EntityUid, EntityUid, String, out Nullable<String>, ContainerSlot, SlotDefinition, InventoryComponent)

Declaration
public bool CanUnequip(EntityUid actor, EntityUid target, string slot, out string? reason, ContainerSlot containerSlot = null, SlotDefinition slotDefinition = null, InventoryComponent inventory = null)
Parameters
Type Name Description
EntityUid actor
EntityUid target
System.String slot
System.Nullable<System.String> reason
Robust.Shared.Containers.ContainerSlot containerSlot
SlotDefinition slotDefinition
InventoryComponent inventory
Returns
Type Description
System.Boolean
| Improve this Doc View Source

CanUnequip(EntityUid, String, out Nullable<String>, ContainerSlot, SlotDefinition, InventoryComponent)

Declaration
public bool CanUnequip(EntityUid uid, string slot, out string? reason, ContainerSlot containerSlot = null, SlotDefinition slotDefinition = null, InventoryComponent inventory = null)
Parameters
Type Name Description
EntityUid uid
System.String slot
System.Nullable<System.String> reason
Robust.Shared.Containers.ContainerSlot containerSlot
SlotDefinition slotDefinition
InventoryComponent inventory
Returns
Type Description
System.Boolean
| Improve this Doc View Source

GetHandOrInventoryEntities(EntityUid, SlotFlags)

Yields all entities in hands or inventory slots with the specific flags.

Declaration
public IEnumerable<EntityUid> GetHandOrInventoryEntities(EntityUid user, SlotFlags flags = default(SlotFlags))
Parameters
Type Name Description
EntityUid user
SlotFlags flags
Returns
Type Description
IEnumerable<EntityUid>
| Improve this Doc View Source

GetSlots(EntityUid, InventoryComponent)

Declaration
public SlotDefinition[] GetSlots(EntityUid uid, InventoryComponent inventoryComponent = null)
Parameters
Type Name Description
EntityUid uid
InventoryComponent inventoryComponent
Returns
Type Description
SlotDefinition[]
| Improve this Doc View Source

HasSlot(EntityUid, String, InventoryComponent)

Declaration
public bool HasSlot(EntityUid uid, string slot, InventoryComponent component = null)
Parameters
Type Name Description
EntityUid uid
System.String slot
InventoryComponent component
Returns
Type Description
System.Boolean
| Improve this Doc View Source

Initialize()

Declaration
public override void Initialize()
| Improve this Doc View Source

InitializeRelay()

Declaration
public void InitializeRelay()
| Improve this Doc View Source

InSlotWithFlags(EntityUid, SlotFlags)

Returns true if the given entity is equipped to an inventory slot with the given inventory slot flags.

Declaration
public bool InSlotWithFlags(EntityUid uid, SlotFlags flags)
Parameters
Type Name Description
EntityUid uid
SlotFlags flags
Returns
Type Description
System.Boolean
| Improve this Doc View Source

OnInit(EntityUid, InventoryComponent, ComponentInit)

Declaration
protected virtual void OnInit(EntityUid uid, InventoryComponent component, ComponentInit args)
Parameters
Type Name Description
EntityUid uid
InventoryComponent component
ComponentInit args
| Improve this Doc View Source

QuickEquip(EntityUid, ClothingComponent, UseInHandEvent)

Declaration
protected void QuickEquip(EntityUid uid, ClothingComponent component, UseInHandEvent args)
Parameters
Type Name Description
EntityUid uid
ClothingComponent component
UseInHandEvent args
| Improve this Doc View Source

RefRelayInventoryEvent<T>(EntityUid, InventoryComponent, ref T)

Declaration
protected void RefRelayInventoryEvent<T>(EntityUid uid, InventoryComponent component, ref T args)
    where T : IInventoryRelayEvent
Parameters
Type Name Description
EntityUid uid
InventoryComponent component
T args
Type Parameters
Name Description
T
| Improve this Doc View Source

RelayInventoryEvent<T>(EntityUid, InventoryComponent, T)

Declaration
protected void RelayInventoryEvent<T>(EntityUid uid, InventoryComponent component, T args)
    where T : IInventoryRelayEvent
Parameters
Type Name Description
EntityUid uid
InventoryComponent component
T args
Type Parameters
Name Description
T
| Improve this Doc View Source

Shutdown()

Declaration
public override void Shutdown()
| Improve this Doc View Source

SpawnItemInSlot(EntityUid, String, String, Boolean, Boolean, InventoryComponent)

Declaration
public bool SpawnItemInSlot(EntityUid uid, string slot, string prototype, bool silent = false, bool force = false, InventoryComponent inventory = null)
Parameters
Type Name Description
EntityUid uid
System.String slot
System.String prototype
System.Boolean silent
System.Boolean force
InventoryComponent inventory
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryEquip(EntityUid, EntityUid, EntityUid, String, Boolean, Boolean, Boolean, InventoryComponent, ClothingComponent)

Declaration
public bool TryEquip(EntityUid actor, EntityUid target, EntityUid itemUid, string slot, bool silent = false, bool force = false, bool predicted = false, InventoryComponent inventory = null, ClothingComponent clothing = null)
Parameters
Type Name Description
EntityUid actor
EntityUid target
EntityUid itemUid
System.String slot
System.Boolean silent
System.Boolean force
System.Boolean predicted
InventoryComponent inventory
ClothingComponent clothing
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryEquip(EntityUid, EntityUid, String, Boolean, Boolean, Boolean, InventoryComponent, ClothingComponent)

Declaration
public bool TryEquip(EntityUid uid, EntityUid itemUid, string slot, bool silent = false, bool force = false, bool predicted = false, InventoryComponent inventory = null, ClothingComponent clothing = null)
Parameters
Type Name Description
EntityUid uid
EntityUid itemUid
System.String slot
System.Boolean silent
System.Boolean force
System.Boolean predicted
InventoryComponent inventory
ClothingComponent clothing
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryGetContainerSlotEnumerator(EntityUid, out InventorySystem.ContainerSlotEnumerator, InventoryComponent)

Declaration
public bool TryGetContainerSlotEnumerator(EntityUid uid, out InventorySystem.ContainerSlotEnumerator containerSlotEnumerator, InventoryComponent component = null)
Parameters
Type Name Description
EntityUid uid
InventorySystem.ContainerSlotEnumerator containerSlotEnumerator
InventoryComponent component
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryGetContainingSlot(EntityUid, out SlotDefinition)

Returns the definition of the inventory slot that the given entity is currently in..

Declaration
public bool TryGetContainingSlot(EntityUid uid, out SlotDefinition slot)
Parameters
Type Name Description
EntityUid uid
SlotDefinition slot
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryGetSlot(EntityUid, String, out SlotDefinition, InventoryComponent)

Declaration
public bool TryGetSlot(EntityUid uid, string slot, out SlotDefinition slotDefinition, InventoryComponent inventory = null)
Parameters
Type Name Description
EntityUid uid
System.String slot
SlotDefinition slotDefinition
InventoryComponent inventory
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryGetSlotContainer(EntityUid, String, out ContainerSlot, out SlotDefinition, InventoryComponent, ContainerManagerComponent)

Declaration
public bool TryGetSlotContainer(EntityUid uid, string slot, out ContainerSlot containerSlot, out SlotDefinition slotDefinition, InventoryComponent inventory = null, ContainerManagerComponent containerComp = null)
Parameters
Type Name Description
EntityUid uid
System.String slot
Robust.Shared.Containers.ContainerSlot containerSlot
SlotDefinition slotDefinition
InventoryComponent inventory
Robust.Shared.Containers.ContainerManagerComponent containerComp
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryGetSlotEntity(EntityUid, String, out Nullable<EntityUid>, InventoryComponent, ContainerManagerComponent)

Declaration
public bool TryGetSlotEntity(EntityUid uid, string slot, out EntityUid? entityUid, InventoryComponent inventoryComponent = null, ContainerManagerComponent containerManagerComponent = null)
Parameters
Type Name Description
EntityUid uid
System.String slot
System.Nullable<EntityUid> entityUid
InventoryComponent inventoryComponent
Robust.Shared.Containers.ContainerManagerComponent containerManagerComponent
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryGetSlots(EntityUid, out SlotDefinition[], InventoryComponent)

Declaration
public bool TryGetSlots(EntityUid uid, out SlotDefinition[] slotDefinitions, InventoryComponent inventoryComponent = null)
Parameters
Type Name Description
EntityUid uid
SlotDefinition[] slotDefinitions
InventoryComponent inventoryComponent
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryUnequip(EntityUid, EntityUid, String, Boolean, Boolean, Boolean, InventoryComponent, ClothingComponent)

Declaration
public bool TryUnequip(EntityUid actor, EntityUid target, string slot, bool silent = false, bool force = false, bool predicted = false, InventoryComponent inventory = null, ClothingComponent clothing = null)
Parameters
Type Name Description
EntityUid actor
EntityUid target
System.String slot
System.Boolean silent
System.Boolean force
System.Boolean predicted
InventoryComponent inventory
ClothingComponent clothing
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryUnequip(EntityUid, EntityUid, String, out Nullable<EntityUid>, Boolean, Boolean, Boolean, InventoryComponent, ClothingComponent)

Declaration
public bool TryUnequip(EntityUid actor, EntityUid target, string slot, out EntityUid? removedItem, bool silent = false, bool force = false, bool predicted = false, InventoryComponent inventory = null, ClothingComponent clothing = null)
Parameters
Type Name Description
EntityUid actor
EntityUid target
System.String slot
System.Nullable<EntityUid> removedItem
System.Boolean silent
System.Boolean force
System.Boolean predicted
InventoryComponent inventory
ClothingComponent clothing
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryUnequip(EntityUid, String, Boolean, Boolean, Boolean, InventoryComponent, ClothingComponent)

Declaration
public bool TryUnequip(EntityUid uid, string slot, bool silent = false, bool force = false, bool predicted = false, InventoryComponent inventory = null, ClothingComponent clothing = null)
Parameters
Type Name Description
EntityUid uid
System.String slot
System.Boolean silent
System.Boolean force
System.Boolean predicted
InventoryComponent inventory
ClothingComponent clothing
Returns
Type Description
System.Boolean
| Improve this Doc View Source

TryUnequip(EntityUid, String, out Nullable<EntityUid>, Boolean, Boolean, Boolean, InventoryComponent, ClothingComponent)

Declaration
public bool TryUnequip(EntityUid uid, string slot, out EntityUid? removedItem, bool silent = false, bool force = false, bool predicted = false, InventoryComponent inventory = null, ClothingComponent clothing = null)
Parameters
Type Name Description
EntityUid uid
System.String slot
System.Nullable<EntityUid> removedItem
System.Boolean silent
System.Boolean force
System.Boolean predicted
InventoryComponent inventory
ClothingComponent clothing
Returns
Type Description
System.Boolean
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾