clean up a bunch of R&D code (#13071)
* clean up a bunch of R&D code * don't store components * brug * speedrun some sloth review
This commit is contained in:
@@ -1,10 +1,21 @@
|
||||
using Content.Server.Power.EntitySystems;
|
||||
using Content.Server.Research.Components;
|
||||
|
||||
namespace Content.Server.Research;
|
||||
namespace Content.Server.Research.Systems;
|
||||
|
||||
public sealed partial class ResearchSystem
|
||||
{
|
||||
private void InitializeSource()
|
||||
{
|
||||
SubscribeLocalEvent<ResearchPointSourceComponent, ResearchServerGetPointsPerSecondEvent>(OnGetPointsPerSecond);
|
||||
}
|
||||
|
||||
private void OnGetPointsPerSecond(EntityUid uid, ResearchPointSourceComponent component, ref ResearchServerGetPointsPerSecondEvent args)
|
||||
{
|
||||
if (CanProduce(component))
|
||||
args.Points += component.PointsPerSecond;
|
||||
}
|
||||
|
||||
public bool CanProduce(ResearchPointSourceComponent component)
|
||||
{
|
||||
return component.Active && this.IsPowered(component.Owner, EntityManager);
|
||||
|
||||
Reference in New Issue
Block a user