Class StationSystem
System that manages stations. A station is, by default, just a name, optional map prototype, and optional grids. For jobs, look at StationJobSystem. For spawning, look at StationSpawningSystem.
Inheritance
Namespace: Content.Server.Station.Systems
Assembly: Content.Server.dll
Syntax
public sealed class StationSystem : EntitySystem
Methods
| Improve this Doc View SourceAddGridToStation(EntityUid, EntityUid, MapGridComponent, StationDataComponent, Nullable<String>)
Adds the given grid to a station.
Declaration
public void AddGridToStation(EntityUid station, EntityUid mapGrid, MapGridComponent gridComponent = null, StationDataComponent stationData = null, string? name = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | station | Station to attach the grid to. |
EntityUid | mapGrid | Grid to attach. |
Robust.Shared.Map.Components.MapGridComponent | gridComponent | Resolve pattern, grid component of mapGrid. |
StationDataComponent | stationData | Resolve pattern, station data component of station. |
System.Nullable<System.String> | name | The name to assign to the grid if any. |
DeleteStation(EntityUid, StationDataComponent)
Deletes the given station.
Declaration
public void DeleteStation(EntityUid station, StationDataComponent stationData = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | station | Station to delete. |
StationDataComponent | stationData | Resolve pattern, station data component of station. |
GetInOwningStation(EntityUid, Single)
Tries to retrieve a filter for everything in the station the source is on.
Declaration
public Filter GetInOwningStation(EntityUid source, float range = 32F)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | source | The entity to use to find the station. |
System.Single | range | The range around the station |
Returns
Type | Description |
---|---|
Robust.Shared.Player.Filter |
GetInStation(StationDataComponent, Single)
Retrieves a filter for everything in a particular station or near its member grids.
Declaration
public Filter GetInStation(StationDataComponent dataComponent, float range = 32F)
Parameters
Type | Name | Description |
---|---|---|
StationDataComponent | dataComponent | |
System.Single | range |
Returns
Type | Description |
---|---|
Robust.Shared.Player.Filter |
GetLargestGrid(StationDataComponent)
Gets the largest member grid from a station.
Declaration
public EntityUid? GetLargestGrid(StationDataComponent component)
Parameters
Type | Name | Description |
---|---|---|
StationDataComponent | component |
Returns
Type | Description |
---|---|
System.Nullable<EntityUid> |
GetOwningStation(EntityUid, Nullable<TransformComponent>)
Gets the station that "owns" the given entity (essentially, the station the grid it's on is attached to)
Declaration
public EntityUid? GetOwningStation(EntityUid entity, TransformComponent? xform = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | entity | Entity to find the owner of. |
System.Nullable<TransformComponent> | xform | Resolve pattern, transform of the entity. |
Returns
Type | Description |
---|---|
System.Nullable<EntityUid> | The owning station, if any. |
Remarks
This does not remember what station an entity started on, it simply checks where it is currently located.
GetStationInMap(MapId)
Returns the first station that has a grid in a certain map. If the map has no stations, null is returned instead.
Declaration
public EntityUid? GetStationInMap(MapId map)
Parameters
Type | Name | Description |
---|---|---|
Robust.Shared.Map.MapId | map |
Returns
Type | Description |
---|---|
System.Nullable<EntityUid> |
Remarks
If there are multiple stations on a map it is probably arbitrary which one is returned.
GetStations()
Declaration
public List<EntityUid> GetStations()
Returns
Type | Description |
---|---|
List<EntityUid> |
GetStationsSet()
Declaration
public HashSet<EntityUid> GetStationsSet()
Returns
Type | Description |
---|---|
HashSet<EntityUid> |
Initialize()
Declaration
public override void Initialize()
InitializeNewStation(StationConfig, Nullable<IEnumerable<EntityUid>>, Nullable<String>)
Initializes a new station with the given information.
Declaration
public EntityUid InitializeNewStation(StationConfig stationConfig, IEnumerable<EntityUid>? gridIds, string? name = null)
Parameters
Type | Name | Description |
---|---|---|
StationConfig | stationConfig | The game map prototype used, if any. |
System.Nullable<IEnumerable<EntityUid>> | gridIds | All grids that should be added to the station. |
System.Nullable<System.String> | name | Optional override for the station name. |
Returns
Type | Description |
---|---|
EntityUid | The initialized station. |
Remarks
This is for ease of use, manually spawning the entity works just fine.
RemoveGridFromStation(EntityUid, EntityUid, MapGridComponent, StationDataComponent)
Removes the given grid from a station.
Declaration
public void RemoveGridFromStation(EntityUid station, EntityUid mapGrid, MapGridComponent gridComponent = null, StationDataComponent stationData = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | station | Station to remove the grid from. |
EntityUid | mapGrid | Grid to remove |
Robust.Shared.Map.Components.MapGridComponent | gridComponent | Resolve pattern, grid component of mapGrid. |
StationDataComponent | stationData | Resolve pattern, station data component of station. |
RenameStation(EntityUid, String, Boolean, StationDataComponent, Nullable<MetaDataComponent>)
Renames the given station.
Declaration
public void RenameStation(EntityUid station, string name, bool loud = true, StationDataComponent stationData = null, MetaDataComponent? metaData = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | station | Station to rename. |
System.String | name | The new name to apply. |
System.Boolean | loud | Whether or not to announce the rename. |
StationDataComponent | stationData | Resolve pattern, station data component of station. |
System.Nullable<MetaDataComponent> | metaData | Resolve pattern, metadata component of station. |
Shutdown()
Declaration
public override void Shutdown()