Class ResearchSystem
Namespace: Content.Server.Research.Systems
Assembly: Content.Server.dll
Syntax
public sealed class ResearchSystem : SharedResearchSystem
Methods
| Improve this Doc View SourceAddLatheRecipe(EntityUid, String, TechnologyDatabaseComponent)
Adds a lathe recipe to the specified technology database without checking if it can be unlocked.
Declaration
public void AddLatheRecipe(EntityUid uid, string recipe, TechnologyDatabaseComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
System.String | recipe | |
TechnologyDatabaseComponent | component |
AddTechnology(EntityUid, TechnologyPrototype, TechnologyDatabaseComponent)
Adds a technology to the database without checking if it could be unlocked.
Declaration
public void AddTechnology(EntityUid uid, TechnologyPrototype technology, TechnologyDatabaseComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
TechnologyPrototype | technology | |
TechnologyDatabaseComponent | component |
AddTechnology(EntityUid, String, TechnologyDatabaseComponent)
Adds a technology to the database without checking if it could be unlocked.
Declaration
public void AddTechnology(EntityUid uid, string technology, TechnologyDatabaseComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
System.String | technology | |
TechnologyDatabaseComponent | component |
CanProduce(ResearchPointSourceComponent)
Declaration
public bool CanProduce(ResearchPointSourceComponent component)
Parameters
Type | Name | Description |
---|---|---|
ResearchPointSourceComponent | component |
Returns
Type | Description |
---|---|
System.Boolean |
CanServerUnlockTechnology(EntityUid, TechnologyPrototype, TechnologyDatabaseComponent, ResearchClientComponent)
Returns whether a technology can be unlocked on this database, taking parent technologies into account.
Declaration
public bool CanServerUnlockTechnology(EntityUid uid, TechnologyPrototype technology, TechnologyDatabaseComponent database = null, ResearchClientComponent client = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
TechnologyPrototype | technology | |
TechnologyDatabaseComponent | database | |
ResearchClientComponent | client |
Returns
Type | Description |
---|---|
System.Boolean | Whether it could be unlocked or not |
GetPointsPerSecond(EntityUid, ResearchServerComponent)
Gets the amount of points generated by all the server's sources in a second.
Declaration
public int GetPointsPerSecond(EntityUid uid, ResearchServerComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
ResearchServerComponent | component |
Returns
Type | Description |
---|---|
System.Int32 |
GetServerIds()
Gets the ids of all the servers
Declaration
public int[] GetServerIds()
Returns
Type | Description |
---|---|
System.Int32[] |
GetServerNames()
Gets the names of all the servers.
Declaration
public string[] GetServerNames()
Returns
Type | Description |
---|---|
System.String[] |
Initialize()
Declaration
public override void Initialize()
Overrides
| Improve this Doc View SourceModifyServerPoints(EntityUid, Int32, ResearchServerComponent)
Adds a specified number of points to a server.
Declaration
public void ModifyServerPoints(EntityUid uid, int points, ResearchServerComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | The server |
System.Int32 | points | The amount of points being added |
ResearchServerComponent | component |
RegisterClient(EntityUid, EntityUid, ResearchClientComponent, ResearchServerComponent, Boolean)
Registers a client to the specified server.
Declaration
public void RegisterClient(EntityUid client, EntityUid server, ResearchClientComponent clientComponent = null, ResearchServerComponent serverComponent = null, bool dirtyServer = true)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | client | The client being registered |
EntityUid | server | The server the client is being registered to |
ResearchClientComponent | clientComponent | |
ResearchServerComponent | serverComponent | |
System.Boolean | dirtyServer | Whether or not to dirty the server component after registration |
Sync(EntityUid, EntityUid, TechnologyDatabaseComponent, TechnologyDatabaseComponent)
Syncs the primary entity's database to that of the secondary entity's database.
Declaration
public void Sync(EntityUid primaryUid, EntityUid otherUid, TechnologyDatabaseComponent primaryDb = null, TechnologyDatabaseComponent otherDb = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | primaryUid | |
EntityUid | otherUid | |
TechnologyDatabaseComponent | primaryDb | |
TechnologyDatabaseComponent | otherDb |
SyncClientWithServer(EntityUid, TechnologyDatabaseComponent, ResearchClientComponent)
If there's a research client component attached to the owner entity, and the research client is connected to a research server, this method syncs against the research server, and the server against the local database.
Declaration
public void SyncClientWithServer(EntityUid uid, TechnologyDatabaseComponent databaseComponent = null, ResearchClientComponent clientComponent = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | |
TechnologyDatabaseComponent | databaseComponent | |
ResearchClientComponent | clientComponent |
TryGetClientServer(EntityUid, out Nullable<EntityUid>, out ResearchServerComponent, ResearchClientComponent)
Tries to get the server belonging to a client
Declaration
public bool TryGetClientServer(EntityUid uid, out EntityUid? server, out ResearchServerComponent serverComponent, ResearchClientComponent component = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | uid | The client |
System.Nullable<EntityUid> | server | It's server. Null if false. |
ResearchServerComponent | serverComponent | The server's ResearchServerComponent. Null if false |
ResearchClientComponent | component | The client's Researchclient component |
Returns
Type | Description |
---|---|
System.Boolean | If the server was successfully retrieved. |
TryGetServerById(Int32, out Nullable<EntityUid>, out ResearchServerComponent)
Gets a server based on it's unique numeric id.
Declaration
public bool TryGetServerById(int id, out EntityUid? serverUid, out ResearchServerComponent serverComponent)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | |
System.Nullable<EntityUid> | serverUid | |
ResearchServerComponent | serverComponent |
Returns
Type | Description |
---|---|
System.Boolean |
UnlockTechnology(EntityUid, TechnologyPrototype, EntityUid, ResearchClientComponent, TechnologyDatabaseComponent)
Tries to add a technology to a database, checking if it is able to
Declaration
public bool UnlockTechnology(EntityUid client, TechnologyPrototype prototype, EntityUid user, ResearchClientComponent component = null, TechnologyDatabaseComponent clientDatabase = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | client | |
TechnologyPrototype | prototype | |
EntityUid | user | |
ResearchClientComponent | component | |
TechnologyDatabaseComponent | clientDatabase |
Returns
Type | Description |
---|---|
System.Boolean | If the technology was successfully added |
UnlockTechnology(EntityUid, String, EntityUid, ResearchClientComponent, TechnologyDatabaseComponent)
Tries to add a technology to a database, checking if it is able to
Declaration
public bool UnlockTechnology(EntityUid client, string prototypeid, EntityUid user, ResearchClientComponent component = null, TechnologyDatabaseComponent clientDatabase = null)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | client | |
System.String | prototypeid | |
EntityUid | user | |
ResearchClientComponent | component | |
TechnologyDatabaseComponent | clientDatabase |
Returns
Type | Description |
---|---|
System.Boolean | If the technology was successfully added |
UnregisterClient(EntityUid, ResearchClientComponent, Boolean)
Unregisterse a client from its server
Declaration
public void UnregisterClient(EntityUid client, ResearchClientComponent clientComponent = null, bool dirtyServer = true)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | client | |
ResearchClientComponent | clientComponent | |
System.Boolean | dirtyServer |
UnregisterClient(EntityUid, EntityUid, ResearchClientComponent, ResearchServerComponent, Boolean)
Unregisters a client from its server
Declaration
public void UnregisterClient(EntityUid client, EntityUid server, ResearchClientComponent clientComponent = null, ResearchServerComponent serverComponent = null, bool dirtyServer = true)
Parameters
Type | Name | Description |
---|---|---|
EntityUid | client | |
EntityUid | server | |
ResearchClientComponent | clientComponent | |
ResearchServerComponent | serverComponent | |
System.Boolean | dirtyServer |
Update(Single)
Declaration
public override void Update(float frameTime)
Parameters
Type | Name | Description |
---|---|---|
System.Single | frameTime |