Skip to content

Feature: World with components definable after initialization #431

@ameligrana

Description

@ameligrana

For now a world can only contain components passed to it at initialization. I saw that Flecs allows also to pass components after that. We could also support that as an optional feature, creating an underlying RunTimeWorld or similar like so

mutable struct RunTimeWorld <: _AbstractWorld
    world::World
end

and if one does add_components!(world, (...)) (maybe also support remove_components!?) we use the still unimplemented #158 to reconstruct the world and then we swap it inside the RunTimeWorld struct. One will pay compile time again but if the user cooperates and uses function barriers no perf penalty should occur. In practice this means the user should unwrap the world autonomously though I think.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureFeature requests and ideas

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions