ChemMaster ECS (#11052)

This commit is contained in:
0x6273
2022-09-06 07:06:47 +02:00
committed by GitHub
parent 34b7e31e76
commit 0c8e52c163
17 changed files with 513 additions and 798 deletions

View File

@@ -1,30 +0,0 @@
using JetBrains.Annotations;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Chemistry.Components;
namespace Content.Shared.Chemistry.EntitySystems
{
[UsedImplicitly]
public abstract class SharedChemMasterSystem : EntitySystem
{
[Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SharedChemMasterComponent, ComponentInit>(OnComponentInit);
SubscribeLocalEvent<SharedChemMasterComponent, ComponentRemove>(OnComponentRemove);
}
private void OnComponentInit(EntityUid uid, SharedChemMasterComponent component, ComponentInit args)
{
_itemSlotsSystem.AddItemSlot(uid, SharedChemMasterComponent.BeakerSlotId, component.BeakerSlot);
}
private void OnComponentRemove(EntityUid uid, SharedChemMasterComponent component, ComponentRemove args)
{
_itemSlotsSystem.RemoveItemSlot(uid, component.BeakerSlot);
}
}
}