Class MaterialStorageSystem
This handles SharedMaterialStorageSystem
Namespace: Content.Server.Materials
Assembly: Content.Server.dll
Syntax
public sealed class MaterialStorageSystem : SharedMaterialStorageSystem
Methods
| Improve this Doc View SourceEjectAllMaterial(EntityUid, Nullable<EntityCoordinates>, MaterialStorageComponent)
Eject all material stored in an entity, with the same mechanics as EjectMaterial(EntityUid, String, Nullable<Int32>, Nullable<EntityCoordinates>, MaterialStorageComponent).
Declaration
public List<EntityUid> EjectAllMaterial(EntityUid entity, EntityCoordinates? coordinates = null, MaterialStorageComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity with storage to eject from. |
System.Nullable<Robust.Shared.Map.EntityCoordinates> | coordinates | The position where to spawn the created sheets. If not given, they're spawned next to the entity. |
MaterialStorageComponent | component | The storage component on |
Returns
Type | Description |
---|---|
List<EntityUid> | The stack entities that were spawned. |
EjectMaterial(EntityUid, String, Nullable<Int32>, Nullable<EntityCoordinates>, MaterialStorageComponent)
Eject a material out of this storage. The internal counts are updated. Material that cannot be ejected stays in storage. (e.g. only have 50 but a sheet needs 100).
Declaration
public List<EntityUid> EjectMaterial(EntityUid entity, string material, int? maxAmount = null, EntityCoordinates? coordinates = null, MaterialStorageComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | The entity with storage to eject from. |
System.String | material | The material prototype to eject. |
System.Nullable<System.Int32> | maxAmount | The maximum amount to eject. If not given, as much as possible is ejected. |
System.Nullable<Robust.Shared.Map.EntityCoordinates> | coordinates | The position where to spawn the created sheets. If not given, they're spawned next to the entity. |
MaterialStorageComponent | component | The storage component on |
Returns
Type | Description |
---|---|
List<EntityUid> | The stack entities that were spawned. |
Initialize()
Declaration
public override void Initialize()
Overrides
| Improve this Doc View SourceSpawnMultipleFromMaterial(Int32, MaterialPrototype, EntityCoordinates)
Spawn an amount of a material in stack entities. Note the 'amount' is material dependent. 1 biomass = 1 biomass in its stack, but 100 plasma = 1 sheet of plasma, etc.
Declaration
public List<EntityUid> SpawnMultipleFromMaterial(int amount, MaterialPrototype materialProto, EntityCoordinates coordinates)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | amount | |
MaterialPrototype | materialProto | |
Robust.Shared.Map.EntityCoordinates | coordinates |
Returns
Type | Description |
---|---|
List<EntityUid> |
SpawnMultipleFromMaterial(Int32, MaterialPrototype, EntityCoordinates, out Int32)
Spawn an amount of a material in stack entities. Note the 'amount' is material dependent. 1 biomass = 1 biomass in its stack, but 100 plasma = 1 sheet of plasma, etc.
Declaration
public List<EntityUid> SpawnMultipleFromMaterial(int amount, MaterialPrototype materialProto, EntityCoordinates coordinates, out int overflowMaterial)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | amount | |
MaterialPrototype | materialProto | |
Robust.Shared.Map.EntityCoordinates | coordinates | |
System.Int32 | overflowMaterial |
Returns
Type | Description |
---|---|
List<EntityUid> |
SpawnMultipleFromMaterial(Int32, String, EntityCoordinates)
Spawn an amount of a material in stack entities. Note the 'amount' is material dependent. 1 biomass = 1 biomass in its stack, but 100 plasma = 1 sheet of plasma, etc.
Declaration
public List<EntityUid> SpawnMultipleFromMaterial(int amount, string material, EntityCoordinates coordinates)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | amount | |
System.String | material | |
Robust.Shared.Map.EntityCoordinates | coordinates |
Returns
Type | Description |
---|---|
List<EntityUid> |
SpawnMultipleFromMaterial(Int32, String, EntityCoordinates, out Int32)
Spawn an amount of a material in stack entities. Note the 'amount' is material dependent. 1 biomass = 1 biomass in its stack, but 100 plasma = 1 sheet of plasma, etc.
Declaration
public List<EntityUid> SpawnMultipleFromMaterial(int amount, string material, EntityCoordinates coordinates, out int overflowMaterial)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | amount | |
System.String | material | |
Robust.Shared.Map.EntityCoordinates | coordinates | |
System.Int32 | overflowMaterial |
Returns
Type | Description |
---|---|
List<EntityUid> |
TryInsertMaterialEntity(EntityUid, EntityUid, EntityUid, MaterialStorageComponent, MaterialComponent, PhysicalCompositionComponent)
Declaration
public override bool TryInsertMaterialEntity(EntityUid user, EntityUid toInsert, EntityUid receiver, MaterialStorageComponent storage = null, MaterialComponent material = null, PhysicalCompositionComponent composition = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | user | |
EntityUid | toInsert | |
EntityUid | receiver | |
MaterialStorageComponent | storage | |
MaterialComponent | material | |
PhysicalCompositionComponent | composition |
Returns
Type | Description |
---|---|
System.Boolean |