ECS and bandaid research (#9251)
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
using Content.Server.Power.Components;
|
||||
|
||||
namespace Content.Server.Research.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
@@ -9,8 +7,6 @@ namespace Content.Server.Research.Components
|
||||
private int _pointsPerSecond;
|
||||
[DataField("active")]
|
||||
private bool _active;
|
||||
private ApcPowerReceiverComponent? _powerReceiver;
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public int PointsPerSecond
|
||||
{
|
||||
@@ -24,18 +20,5 @@ namespace Content.Server.Research.Components
|
||||
get => _active;
|
||||
set => _active = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether this can be used to produce research points.
|
||||
/// </summary>
|
||||
/// <remarks>If no <see cref="ApcPowerReceiverComponent"/> is found, it's assumed power is not required.</remarks>
|
||||
[ViewVariables]
|
||||
public bool CanProduce => Active && (_powerReceiver is null || _powerReceiver.Powered);
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out _powerReceiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user