Class StationRecordsSystem
Station records.
A station record is tied to an ID card, or anything that holds a station record's key. This key will determine access to a station record set's record entries, and it is imperative not to lose the item that holds the key under any circumstance.
Records are mostly a roleplaying tool, but can have some functionality as well (i.e., security records indicating that a specific person holding an ID card with a linked key is currently under warrant, showing a crew manifest with user settable, custom titles).
General records are tied into this system, as most crewmembers should have a general record - and most systems should probably depend on this general record being created. This is subject to change.
Namespace: Content.Server.StationRecords.Systems
Assembly: Content.Server.dll
Syntax
public sealed class StationRecordsSystem : SharedStationRecordsSystem
Methods
| Improve this Doc View SourceAddRecordEntry<T>(EntityUid, T, StationRecordsComponent)
Adds a record entry to a station's record set.
Declaration
public StationRecordKey AddRecordEntry<T>(EntityUid station, T record, StationRecordsComponent records = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | station | The station to add the record to. |
T | record | The record to add. |
StationRecordsComponent | records | Station records component. |
Returns
Type | Description |
---|---|
StationRecordKey |
Type Parameters
Name | Description |
---|---|
T | The type of record to add. |
CreateGeneralRecord(EntityUid, Nullable<EntityUid>, String, Int32, String, Gender, String, Nullable<String>, Nullable<String>, HumanoidCharacterProfile, StationRecordsComponent)
Create a general record to store in a station's record set.
Declaration
public void CreateGeneralRecord(EntityUid station, EntityUid? idUid, string name, int age, string species, Gender gender, string jobId, string? mobFingerprint, string? dna, HumanoidCharacterProfile profile = null, StationRecordsComponent records = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | station | The entity uid of the station. |
System.Nullable<EntityUid> | idUid | The entity uid of an entity's ID card. Can be null. |
System.String | name | Name of the character. |
System.Int32 | age | |
System.String | species | Species of the character. |
Robust.Shared.Enums.Gender | gender | Gender of the character. |
System.String | jobId | The job to initially tie this record to. This must be a valid job loaded in, otherwise this call will cause an exception. Ensure that a general record starts out with a job that is currently a valid job prototype. |
System.Nullable<System.String> | mobFingerprint | Fingerprint of the character. |
System.Nullable<System.String> | dna | DNA of the character. |
HumanoidCharacterProfile | profile | Profile for the related player. This is so that other systems can get further information about the player character. Optional - other systems should anticipate this. |
StationRecordsComponent | records | Station records component. |
Remarks
This is tied into the record system, as any crew member's records should generally be dependent on some generic record with the bare minimum of information involved.
GetRecordsOfType<T>(EntityUid, StationRecordsComponent)
Gets all records of a specific type from a station.
Declaration
public IEnumerable<(StationRecordKey, T)> GetRecordsOfType<T>(EntityUid station, StationRecordsComponent records = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | station | The station to get the records from. |
StationRecordsComponent | records | Station records component. |
Returns
Type | Description |
---|---|
IEnumerable<System.ValueTuple<StationRecordKey, T>> | Enumerable of pairs with a station record key, and the entry in question of type T. |
Type Parameters
Name | Description |
---|---|
T | Type of record to fetch |
Initialize()
Declaration
public override void Initialize()
RemoveRecord(EntityUid, StationRecordKey, StationRecordsComponent)
Removes a record from this station.
Declaration
public bool RemoveRecord(EntityUid station, StationRecordKey key, StationRecordsComponent records = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | station | Station to remove the record from. |
StationRecordKey | key | The key to remove. |
StationRecordsComponent | records | Station records component. |
Returns
Type | Description |
---|---|
System.Boolean | True if the record was removed, false otherwise. |
Synchronize(EntityUid, StationRecordsComponent)
Synchronizes a station's records with any systems that need it.
Declaration
public void Synchronize(EntityUid station, StationRecordsComponent records = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | station | The station to synchronize any recently accessed records with.. |
StationRecordsComponent | records | Station records component. |
TryGetRecord<T>(EntityUid, StationRecordKey, out T, StationRecordsComponent)
Try to get a record from this station's record entries, from the provided station record key. Will always return null if the key does not match the station.
Declaration
public bool TryGetRecord<T>(EntityUid station, StationRecordKey key, out T entry, StationRecordsComponent records = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | station | Station to get the record from. |
StationRecordKey | key | Key to try and index from the record set. |
T | entry | The resulting entry. |
StationRecordsComponent | records | Station record component. |
Returns
Type | Description |
---|---|
System.Boolean | True if the record was obtained, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Type to get from the record set. |