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

@@ -54,7 +54,7 @@ public sealed partial class BuildMech : IGraphAction
return;
}
container.Remove(cell);
containerSystem.Remove(cell, container);
var transform = entityManager.GetComponent<TransformComponent>(uid);
var mech = entityManager.SpawnEntity(MechPrototype, transform.Coordinates);
@@ -62,7 +62,7 @@ public sealed partial class BuildMech : IGraphAction
if (entityManager.TryGetComponent<MechComponent>(mech, out var mechComp) && mechComp.BatterySlot.ContainedEntity == null)
{
mechSys.InsertBattery(mech, cell, mechComp, batteryComponent);
mechComp.BatterySlot.Insert(cell);
containerSystem.Insert(cell, mechComp.BatterySlot);
}
var entChangeEv = new ConstructionChangeEntityEvent(mech, uid);

View File

@@ -21,7 +21,7 @@ namespace Content.Server.Construction.Completions
foreach (var contained in container.ContainedEntities.ToArray())
{
if(container.Remove(contained))
if(containerSys.Remove(contained, container))
entityManager.QueueDeleteEntity(contained);
}
}

View File

@@ -26,8 +26,8 @@ namespace Content.Server.Construction.Completions
foreach (var contained in from.ContainedEntities.ToArray())
{
if (from.Remove(contained))
to.Insert(contained);
if (containerSystem.Remove(contained, from))
containerSystem.Insert(contained, to);
}
}
}

View File

@@ -24,7 +24,7 @@ namespace Content.Server.Construction.Completions
var coordinates = entityManager.GetComponent<TransformComponent>(uid).Coordinates;
for (var i = 0; i < Amount; i++)
{
container.Insert(entityManager.SpawnEntity(Prototype, coordinates));
containerSystem.Insert(entityManager.SpawnEntity(Prototype, coordinates), container);
}
}
}