[x] Create SpawnPointComponent; contains a list of entities containing SpawnComponent
[x] Create SpawnedComponent; contains source (entity with SpawnComponent).
[x] Update World::Helpers.spawn to recursively call spawn on each entity in ContainerComponent#contents, SpawnPointComponent#list
[x] Update System::Spawner to iterate through SpawnPointComponent.list, spawning entity in SpawnComponent into ContentComponent of entity containing SpawnPointComponent
[x] Create World::Helpers.destroy_entity wrapper that updates SpawnPointComponent.active when destroying entity with SpawnedComponent
This scenario will allow us to support:
static spawning
Room entity has ContainerComponent that contains base:obj/fountain; present when loaded
NPC entity template has EquipmentComponent that contains base:obj/sword; spawned on entity when entity spawned
dynamic spawning
Room entity has SpawnPointComponent with a list of SpawnComponents; each SpawnComponent spawns something in room entity
Object template entity has SpawnPointComponent; when entity is spawned, each SpawnComponent referenced is also Spawned, and added to created entity SpawnPointComponent for processing
World::Helpers.spawn
to recursively call spawn on each entity in ContainerComponent#contents, SpawnPointComponent#listSystem::Spawner
to iterate throughSpawnPointComponent.list
, spawning entity inSpawnComponent
into ContentComponent of entity containingSpawnPointComponent
World::Helpers.destroy_entity
wrapper that updatesSpawnPointComponent.active
when destroying entity withSpawnedComponent
This scenario will allow us to support:
This really needs a diagram