Content ecs containers (#22484)

This commit is contained in:
TemporalOroboros
2023-12-27 21:30:03 -08:00
committed by GitHub
parent 1d06539432
commit 7a77d6d5dd
72 changed files with 172 additions and 160 deletions

View File

@@ -133,14 +133,14 @@ namespace Content.Server.Construction
{
foreach (var entity in container.ContainedEntities.ToArray())
{
container.Remove(entity);
_container.Remove(entity, container);
}
foreach (var cont in containers.Values)
{
foreach (var entity in cont.ContainedEntities.ToArray())
{
cont.Remove(entity);
_container.Remove(entity, cont);
}
}
@@ -150,10 +150,10 @@ namespace Content.Server.Construction
void ShutdownContainers()
{
container.Shutdown();
_container.ShutdownContainer(container);
foreach (var c in containers.Values.ToArray())
{
c.Shutdown();
_container.ShutdownContainer(c);
}
}
@@ -188,10 +188,10 @@ namespace Content.Server.Construction
if (string.IsNullOrEmpty(materialStep.Store))
{
if (!container.Insert(splitStack.Value))
if (!_container.Insert(splitStack.Value, container))
continue;
}
else if (!GetContainer(materialStep.Store).Insert(splitStack.Value))
else if (!_container.Insert(splitStack.Value, GetContainer(materialStep.Store)))
continue;
handled = true;
@@ -217,10 +217,10 @@ namespace Content.Server.Construction
if (string.IsNullOrEmpty(arbitraryStep.Store))
{
if (!container.Insert(entity))
if (!_container.Insert(entity, container))
continue;
}
else if (!GetContainer(arbitraryStep.Store).Insert(entity))
else if (!_container.Insert(entity, GetContainer(arbitraryStep.Store)))
continue;
handled = true;
@@ -284,8 +284,8 @@ namespace Content.Server.Construction
foreach (var entity in cont.ContainedEntities.ToArray())
{
cont.ForceRemove(entity);
newCont.Insert(entity);
_container.Remove(entity, cont, reparent: false, force: true);
_container.Insert(entity, newCont);
}
}