Update trivial components to use auto comp states (#20539)
This commit is contained in:
@@ -9,7 +9,6 @@ using Content.Shared.Examine;
|
||||
using Content.Shared.Mobs.Components;
|
||||
using Content.Shared.Stacks;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Physics.Events;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
@@ -32,8 +31,6 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<MaterialReclaimerComponent, ComponentGetState>(OnGetState);
|
||||
SubscribeLocalEvent<MaterialReclaimerComponent, ComponentHandleState>(OnHandleState);
|
||||
SubscribeLocalEvent<MaterialReclaimerComponent, ComponentShutdown>(OnShutdown);
|
||||
SubscribeLocalEvent<MaterialReclaimerComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<MaterialReclaimerComponent, ExaminedEvent>(OnExamined);
|
||||
@@ -43,24 +40,6 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
|
||||
SubscribeLocalEvent<ActiveMaterialReclaimerComponent, EntityUnpausedEvent>(OnActiveUnpaused);
|
||||
}
|
||||
|
||||
private void OnGetState(EntityUid uid, MaterialReclaimerComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new MaterialReclaimerComponentState(component.Powered,
|
||||
component.Enabled,
|
||||
component.MaterialProcessRate,
|
||||
component.ItemsProcessed);
|
||||
}
|
||||
|
||||
private void OnHandleState(EntityUid uid, MaterialReclaimerComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if (args.Current is not MaterialReclaimerComponentState state)
|
||||
return;
|
||||
component.Powered = state.Powered;
|
||||
component.Enabled = state.Enabled;
|
||||
component.MaterialProcessRate = state.MaterialProcessRate;
|
||||
component.ItemsProcessed = state.ItemsProcessed;
|
||||
}
|
||||
|
||||
private void OnShutdown(EntityUid uid, MaterialReclaimerComponent component, ComponentShutdown args)
|
||||
{
|
||||
component.Stream?.Stop();
|
||||
|
||||
Reference in New Issue
Block a user