Class StackSystem
Entity system that handles everything relating to stacks.
This is a good example for learning how to code in an ECS manner.
Inheritance
System.Object
StackSystem
Assembly: Content.Server.dll
Syntax
public sealed class StackSystem : SharedStackSystem
Fields
|
Improve this Doc
View Source
DefaultSplitAmounts
Declaration
public static readonly int[] DefaultSplitAmounts
Field Value
Type |
Description |
System.Int32[] |
|
Methods
|
Improve this Doc
View Source
Initialize()
Declaration
public override void Initialize()
Overrides
|
Improve this Doc
View Source
SetCount(EntityUid, Int32, StackComponent)
Declaration
public override 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
Spawn(Int32, StackPrototype, EntityCoordinates)
Declaration
public EntityUid Spawn(int amount, StackPrototype prototype, EntityCoordinates spawnPosition)
Parameters
Type |
Name |
Description |
System.Int32 |
amount |
|
StackPrototype |
prototype |
|
Robust.Shared.Map.EntityCoordinates |
spawnPosition |
|
Returns
Type |
Description |
EntityUid |
|
|
Improve this Doc
View Source
SpawnMultiple(String, Int32, EntityCoordinates)
Say you want to spawn 97 units of something that has a max stack count of 30.
This would spawn 3 stacks of 30 and 1 stack of 7.
Declaration
public List<EntityUid> SpawnMultiple(string entityPrototype, int amount, EntityCoordinates spawnPosition)
Parameters
Type |
Name |
Description |
System.String |
entityPrototype |
|
System.Int32 |
amount |
|
Robust.Shared.Map.EntityCoordinates |
spawnPosition |
|
Returns
Type |
Description |
List<EntityUid> |
|
|
Improve this Doc
View Source
Split(EntityUid, Int32, EntityCoordinates, StackComponent)
Try to split this stack into two. Returns a non-null Robust.Shared.GameObjects.EntityUid if successful.
Declaration
public EntityUid? Split(EntityUid uid, int amount, EntityCoordinates spawnPosition, StackComponent stack = null)
Parameters
Type |
Name |
Description |
EntityUid |
uid |
|
System.Int32 |
amount |
|
Robust.Shared.Map.EntityCoordinates |
spawnPosition |
|
StackComponent |
stack |
|
Returns
Type |
Description |
System.Nullable<EntityUid> |
|