Files
tbd-station-14/Content.Server/GameObjects/Components/Cargo/CargoOrderDatabaseComponent.cs
Acruid ca4fd649fe Massive Namespace Cleanup (#3120)
* Engine namespace changes.

* Automated remove redundant using statements.

* Simplified Graphics namespace.

* Apparently the container system stores full type names in the map file.😞 This updates those names.

* API Changes to LocalizationManager.LoadCulture.

* Update submodule to v0.3.2
2021-02-11 01:13:03 -08:00

29 lines
879 B
C#

using Content.Server.Cargo;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Cargo;
using Robust.Shared.GameObjects;
namespace Content.Server.GameObjects.Components.Cargo
{
[RegisterComponent]
public class CargoOrderDatabaseComponent : SharedCargoOrderDatabaseComponent
{
public CargoOrderDatabase Database { get; set; }
public bool ConnectedToDatabase => Database != null;
public override void Initialize()
{
base.Initialize();
Database = EntitySystem.Get<CargoConsoleSystem>().StationOrderDatabase;
}
public override ComponentState GetComponentState()
{
if (!ConnectedToDatabase)
return new CargoOrderDatabaseState(null);
return new CargoOrderDatabaseState(Database.GetOrders());
}
}
}