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:
Nemanja
2022-12-19 16:14:02 -05:00
committed by GitHub
parent f78dca8504
commit 0549b22cbc
12 changed files with 159 additions and 143 deletions

View File

@@ -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);