Show / Hide Table of Contents

Class SharedMaterialStorageSystem

This handles storing materials and modifying their amounts MaterialStorageComponent

Inheritance
System.Object
SharedMaterialStorageSystem
MaterialStorageSystem
MaterialStorageSystem
Namespace: Content.Shared.Materials
Assembly: Content.Shared.dll
Syntax
public abstract class SharedMaterialStorageSystem : EntitySystem

Methods

| Improve this Doc View Source

CanChangeMaterialAmount(EntityUid, String, Int32, MaterialStorageComponent)

Checks if the specified material can be changed by the specified volume.

Declaration
public bool CanChangeMaterialAmount(EntityUid uid, string materialId, int volume, MaterialStorageComponent component = null)
Parameters
Type Name Description
EntityUid uid
System.String materialId
System.Int32 volume
MaterialStorageComponent component
Returns
Type Description
System.Boolean

If the amount can be changed

| Improve this Doc View Source

CanTakeVolume(EntityUid, Int32, MaterialStorageComponent)

Tests if a specific amount of volume will fit in the storage.

Declaration
public bool CanTakeVolume(EntityUid uid, int volume, MaterialStorageComponent component = null)
Parameters
Type Name Description
EntityUid uid
System.Int32 volume
MaterialStorageComponent component
Returns
Type Description
System.Boolean

If the specified volume will fit

| Improve this Doc View Source

GetMaterialAmount(EntityUid, MaterialPrototype, MaterialStorageComponent)

Gets the volume of a specified material contained in this storage.

Declaration
public int GetMaterialAmount(EntityUid uid, MaterialPrototype material, MaterialStorageComponent component = null)
Parameters
Type Name Description
EntityUid uid
MaterialPrototype material
MaterialStorageComponent component
Returns
Type Description
System.Int32

The volume of the material

| Improve this Doc View Source

GetMaterialAmount(EntityUid, String, MaterialStorageComponent)

Gets the volume of a specified material contained in this storage.

Declaration
public int GetMaterialAmount(EntityUid uid, string material, MaterialStorageComponent component = null)
Parameters
Type Name Description
EntityUid uid
System.String material
MaterialStorageComponent component
Returns
Type Description
System.Int32

The volume of the material

| Improve this Doc View Source

GetTotalMaterialAmount(EntityUid, MaterialStorageComponent)

Gets the total volume of all materials in the storage.

Declaration
public int GetTotalMaterialAmount(EntityUid uid, MaterialStorageComponent component = null)
Parameters
Type Name Description
EntityUid uid
MaterialStorageComponent component
Returns
Type Description
System.Int32

The volume of all materials in the storage

| Improve this Doc View Source

Initialize()

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

TryChangeMaterialAmount(EntityUid, String, Int32, MaterialStorageComponent)

Changes the amount of a specific material in the storage. Still respects the filters in place.

Declaration
public bool TryChangeMaterialAmount(EntityUid uid, string materialId, int volume, MaterialStorageComponent component = null)
Parameters
Type Name Description
EntityUid uid
System.String materialId
System.Int32 volume
MaterialStorageComponent component
Returns
Type Description
System.Boolean

If it was successful

| Improve this Doc View Source

TryInsertMaterialEntity(EntityUid, EntityUid, EntityUid, MaterialStorageComponent, MaterialComponent, PhysicalCompositionComponent)

Tries to insert an entity into the material storage.

Declaration
public virtual 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
| Improve this Doc View Source

TrySetMaterialAmount(EntityUid, String, Int32, MaterialStorageComponent)

Tries to set the amount of material in the storage to a specific value. Still respects the filters in place.

Declaration
public bool TrySetMaterialAmount(EntityUid uid, string materialId, int volume, MaterialStorageComponent component = null)
Parameters
Type Name Description
EntityUid uid

The entity to change the material storage on.

System.String materialId

The ID of the material to change.

System.Int32 volume

The stored material volume to set the storage to.

MaterialStorageComponent component

The storage component on uid. Resolved automatically if not given.

Returns
Type Description
System.Boolean

True if it was successful (enough space etc).

| Improve this Doc View Source

Update(Single)

Declaration
public override void Update(float frameTime)
Parameters
Type Name Description
System.Single frameTime
| Improve this Doc View Source

UpdateMaterialWhitelist(EntityUid, MaterialStorageComponent)

Broadcasts an event that will collect a list of which materials are allowed to be inserted into the materialStorage.

Declaration
public void UpdateMaterialWhitelist(EntityUid uid, MaterialStorageComponent component = null)
Parameters
Type Name Description
EntityUid uid
MaterialStorageComponent component
  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾