Power Rework (#863)

Co-authored-by: py01 <pyronetics01@gmail.com>
This commit is contained in:
py01
2020-06-28 09:23:26 -06:00
committed by GitHub
parent ffe25de723
commit 23cc6b1d4e
154 changed files with 11253 additions and 3913 deletions

View File

@@ -9,6 +9,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
using Robust.Shared.Utility;
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
namespace Content.Server.GameObjects.Components.Research
{
@@ -65,11 +66,11 @@ namespace Content.Server.GameObjects.Components.Research
}
}
/// <remarks>If no <see cref="PowerDeviceComponent"/> is found, it's assumed power is not required.</remarks>
/// <remarks>If no <see cref="PowerReceiverComponent"/> is found, it's assumed power is not required.</remarks>
[ViewVariables]
public bool CanRun => _powerDevice is null || _powerDevice.Powered;
public bool CanRun => _powerReceiver is null || _powerReceiver.Powered;
private PowerDeviceComponent _powerDevice;
private PowerReceiverComponent _powerReceiver;
public override void Initialize()
{
@@ -77,7 +78,7 @@ namespace Content.Server.GameObjects.Components.Research
Id = ServerCount++;
EntitySystem.Get<ResearchSystem>()?.RegisterServer(this);
Database = Owner.GetComponent<TechnologyDatabaseComponent>();
Owner.TryGetComponent(out _powerDevice);
Owner.TryGetComponent(out _powerReceiver);
}
/// <inheritdoc />