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

@@ -1,3 +1,4 @@
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
using Content.Server.GameObjects.Components.Power;
using Content.Server.GameObjects.EntitySystems;
using Robust.Shared.GameObjects;
@@ -14,7 +15,7 @@ namespace Content.Server.GameObjects.Components.Research
private int _pointsPerSecond;
private bool _active;
private PowerDeviceComponent _powerDevice;
private PowerReceiverComponent _powerReceiver;
[ViewVariables]
public int PointsPerSecond
@@ -33,13 +34,13 @@ namespace Content.Server.GameObjects.Components.Research
/// <summary>
/// Whether this can be used to produce research points.
/// </summary>
/// <remarks>If no <see cref="PowerDeviceComponent"/> is found, it's assumed power is not required.</remarks>
public bool CanProduce => Active && (_powerDevice is null || _powerDevice.Powered);
/// <remarks>If no <see cref="PowerReceiverComponent"/> is found, it's assumed power is not required.</remarks>
public bool CanProduce => Active && (_powerReceiver is null || _powerReceiver.Powered);
public override void Initialize()
{
base.Initialize();
Owner.TryGetComponent(out _powerDevice);
Owner.TryGetComponent(out _powerReceiver);
}
public override void ExposeData(ObjectSerializer serializer)