Refactors the CargoOrderDataManager into the CargoConsoleSystem (#2858)

* Update submodule

* Refactor CargoOrderDataManager into CargoConsoleSystem

* Fix OnRemove event

Co-authored-by: Radrark <null>
This commit is contained in:
Radrark
2021-01-09 02:11:09 -03:00
committed by GitHub
parent 79dd7a7d7e
commit 670d277963
6 changed files with 101 additions and 140 deletions

View File

@@ -1,6 +1,8 @@
using Content.Server.Cargo;
using Content.Server.Cargo;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Cargo;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.IoC;
namespace Content.Server.GameObjects.Components.Cargo
@@ -8,8 +10,6 @@ namespace Content.Server.GameObjects.Components.Cargo
[RegisterComponent]
public class CargoOrderDatabaseComponent : SharedCargoOrderDatabaseComponent
{
[Dependency] private readonly ICargoOrderDataManager _cargoOrderDataManager = default!;
public CargoOrderDatabase Database { get; set; }
public bool ConnectedToDatabase => Database != null;
@@ -17,7 +17,7 @@ namespace Content.Server.GameObjects.Components.Cargo
{
base.Initialize();
_cargoOrderDataManager.AddComponent(this);
Database = EntitySystem.Get<CargoConsoleSystem>().StationOrderDatabase;
}
public override ComponentState GetComponentState()