Class SharedStackSystem
Inheritance
System.Object
SharedStackSystem
Assembly: Content.Shared.dll
Syntax
public abstract class SharedStackSystem : EntitySystem
Fields
|
Improve this Doc
View Source
Appearance
Declaration
protected readonly SharedAppearanceSystem Appearance
Field Value
Type |
Description |
SharedAppearanceSystem |
|
|
Improve this Doc
View Source
Hands
Declaration
protected readonly SharedHandsSystem Hands
Field Value
|
Improve this Doc
View Source
Declaration
protected readonly SharedPopupSystem Popup
Field Value
|
Improve this Doc
View Source
Xform
Declaration
protected readonly SharedTransformSystem Xform
Field Value
Type |
Description |
SharedTransformSystem |
|
Methods
|
Improve this Doc
View Source
GetAvailableSpace(StackComponent)
Gets the remaining space in a stack.
Declaration
public int GetAvailableSpace(StackComponent component)
Parameters
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
GetCount(EntityUid, StackComponent)
Gets the amount of items in a stack. If it cannot be stacked, returns 1.
Declaration
public int GetCount(EntityUid uid, StackComponent component = null)
Parameters
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
GetMaxCount(StackComponent)
Gets the maximum amount that can be fit on a stack.
Declaration
public int GetMaxCount(StackComponent component)
Parameters
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
GetMaxCount(EntityUid)
Gets the max count for a given entity
Declaration
public int GetMaxCount(EntityUid uid)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
GetMaxCount(String)
Gets the max count for a given entity prototype
Declaration
public int GetMaxCount(string entityId)
Parameters
Type |
Name |
Description |
System.String |
entityId |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Initialize()
Declaration
public override void Initialize()
|
Improve this Doc
View Source
SetCount(EntityUid, Int32, StackComponent)
Declaration
public virtual void SetCount(EntityUid uid, int amount, StackComponent component = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
System.Int32 |
amount |
|
StackComponent |
component |
|
|
Improve this Doc
View Source
Shutdown()
Declaration
public override void Shutdown()
|
Improve this Doc
View Source
TryAdd(EntityUid, EntityUid, StackComponent, StackComponent)
Tries to add one stack to another. May have some leftover count in the inserted entity.
Declaration
public bool TryAdd(EntityUid insertEnt, EntityUid targetEnt, StackComponent insertStack = null, StackComponent targetStack = null)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryAdd(EntityUid, EntityUid, Int32, StackComponent, StackComponent)
Tries to add one stack to another. May have some leftover count in the inserted entity.
Declaration
public bool TryAdd(EntityUid insertEnt, EntityUid targetEnt, int count, StackComponent insertStack = null, StackComponent targetStack = null)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryMergeToContacts(EntityUid, StackComponent, Nullable<TransformComponent>)
Tries to merge a stack into any of the stacks it is touching.
Declaration
public bool TryMergeToContacts(EntityUid uid, StackComponent stack = null, TransformComponent? xform = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
StackComponent |
stack |
|
System.Nullable<TransformComponent> |
xform |
|
Returns
Type |
Description |
System.Boolean |
Whether or not it was successfully merged into another stack
|
|
Improve this Doc
View Source
TryMergeToHands(EntityUid, EntityUid, StackComponent, HandsComponent)
If the given item is a stack, this attempts to find a matching stack in the users hand, and merge with that.
Declaration
public void TryMergeToHands(EntityUid item, EntityUid user, StackComponent itemStack = null, HandsComponent hands = null)
Parameters
Remarks
|
Improve this Doc
View Source
Use(EntityUid, Int32, StackComponent)
Try to use an amount of items on this stack. Returns whether this succeeded.
Declaration
public bool Use(EntityUid uid, int amount, StackComponent stack = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
System.Int32 |
amount |
|
StackComponent |
stack |
|
Returns
Type |
Description |
System.Boolean |
|