EntityStorage ECS (#9291)

This commit is contained in:
Nemanja
2022-07-13 19:11:59 -04:00
committed by GitHub
parent a655891a8d
commit 5edf2ccad5
46 changed files with 1057 additions and 1126 deletions

View File

@@ -0,0 +1,23 @@
using Content.Server.Storage.Components;
using Content.Server.Xenoarchaeology.XenoArtifacts;
namespace Content.Server.Storage.EntitySystems;
public sealed class ArtifactStorageSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ArtifactStorageComponent, StorageBeforeCloseEvent>(OnBeforeClose);
}
private void OnBeforeClose(EntityUid uid, ArtifactStorageComponent component, StorageBeforeCloseEvent args)
{
foreach (var ent in args.Contents)
{
if (HasComp<ArtifactComponent>(ent))
args.ContentsWhitelist.Add(ent);
}
}
}