Class SharedMechSystem
Handles all of the interactions, UI handling, and items shennanigans for MechComponent
Namespace: Content.Shared.Mech.EntitySystems
Assembly: Content.Shared.dll
Syntax
public abstract class SharedMechSystem : EntitySystem
Methods
| Improve this Doc View SourceBreakMech(EntityUid, MechComponent)
Destroys the mech, removing the user and ejecting all installed equipment.
Declaration
public virtual void BreakMech(EntityUid uid, MechComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
MechComponent | component |
CanInsert(EntityUid, EntityUid, MechComponent)
Checks if an entity can be inserted into the mech.
Declaration
public bool CanInsert(EntityUid uid, EntityUid toInsert, MechComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
EntityUid | toInsert | |
MechComponent | component |
Returns
Type | Description |
---|---|
System.Boolean |
CycleEquipment(EntityUid, MechComponent)
Cycles through the currently selected equipment.
Declaration
public void CycleEquipment(EntityUid uid, MechComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
MechComponent | component |
Initialize()
Declaration
public override void Initialize()
InsertEquipment(EntityUid, EntityUid, MechComponent, MechEquipmentComponent)
Inserts an equipment item into the mech.
Declaration
public void InsertEquipment(EntityUid uid, EntityUid toInsert, MechComponent component = null, MechEquipmentComponent equipmentComponent = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
EntityUid | toInsert | |
MechComponent | component | |
MechEquipmentComponent | equipmentComponent |
IsEmpty(MechComponent)
Checks if the pilot is present
Declaration
public bool IsEmpty(MechComponent component)
Parameters
Type | Name | Description |
---|---|---|
MechComponent | component |
Returns
Type | Description |
---|---|
System.Boolean | Whether or not the pilot is present |
RemoveEquipment(EntityUid, EntityUid, MechComponent, MechEquipmentComponent, Boolean)
Removes an equipment item from a mech.
Declaration
public void RemoveEquipment(EntityUid uid, EntityUid toRemove, MechComponent component = null, MechEquipmentComponent equipmentComponent = null, bool forced = false)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
EntityUid | toRemove | |
MechComponent | component | |
MechEquipmentComponent | equipmentComponent | |
System.Boolean | forced | Whether or not the removal can be cancelled |
SetIntegrity(EntityUid, FixedPoint2, MechComponent)
Sets the integrity of the mech.
Declaration
public void SetIntegrity(EntityUid uid, FixedPoint2 value, MechComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | The mech itself |
FixedPoint2 | value | The value the integrity will be set at |
MechComponent | component |
TryChangeEnergy(EntityUid, FixedPoint2, MechComponent)
Attempts to change the amount of energy in the mech.
Declaration
public virtual bool TryChangeEnergy(EntityUid uid, FixedPoint2 delta, MechComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | The mech itself |
FixedPoint2 | delta | The change in energy |
MechComponent | component |
Returns
Type | Description |
---|---|
System.Boolean | If the energy was successfully changed. |
TryEject(EntityUid, MechComponent)
Attempts to eject the current pilot from the mech
Declaration
public bool TryEject(EntityUid uid, MechComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
MechComponent | component |
Returns
Type | Description |
---|---|
System.Boolean | Whether or not the pilot was ejected. |
TryInsert(EntityUid, Nullable<EntityUid>, MechComponent)
Attempts to insert a pilot into the mech.
Declaration
public bool TryInsert(EntityUid uid, EntityUid? toInsert, MechComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
System.Nullable<EntityUid> | toInsert | |
MechComponent | component |
Returns
Type | Description |
---|---|
System.Boolean | Whether or not the entity was inserted |
UpdateUserInterface(EntityUid, MechComponent)
Updates the user interface
Declaration
public virtual void UpdateUserInterface(EntityUid uid, MechComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
MechComponent | component |
Remarks
This is defined here so that UI updates can be accessed from shared.