Show / Hide Table of Contents

Class SharedStackSystem

Inheritance
System.Object
SharedStackSystem
StackSystem
StackSystem
Namespace: Content.Shared.Stacks
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
Type Description
SharedHandsSystem
| Improve this Doc View Source

Popup

Declaration
protected readonly SharedPopupSystem Popup
Field Value
Type Description
SharedPopupSystem
| 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
Type Name Description
StackComponent component
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
Type Name Description
EntityUid uid
StackComponent component
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
Type Name Description
StackComponent component
Returns
Type Description
System.Int32
Remarks

if there's no stackcomp, this equals 1. Otherwise, if there's a max count override, it equals that. It then checks for a max count value on the prototype. If there isn't one, it defaults to the max integer value (unlimimted).

| 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
Type Name Description
EntityUid insertEnt
EntityUid targetEnt
StackComponent insertStack
StackComponent targetStack
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
Type Name Description
EntityUid insertEnt
EntityUid targetEnt
System.Int32 count
StackComponent insertStack
StackComponent targetStack
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
Type Name Description
EntityUid item
EntityUid user
StackComponent itemStack
HandsComponent hands
Remarks

If the interaction fails to fully merge the stack, or if this is just not a stack, it will instead try to place it in the user's hand normally.

| 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
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾