Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add system to automatically switch default GFWorld depending on the context #43

Open
Tracked by #62
GsLogiMaker opened this issue Dec 6, 2024 · 0 comments
Open
Tracked by #62
Labels
enhancement New feature or request

Comments

@GsLogiMaker
Copy link
Owner

Due to how Glecs is structured, it is common to have to explicitly state in what world the user wants to be creating entities, systems, and components. This leads to code that is more verbose than it should be. For example, when registering items within modules:

extends GFModule

def _register(world:GFWorld) -> void:
    # This line requires the world to be specified, otherwise
    # the system might not be defined in the same world as the
    # module.
    GFSystemBuilder.new_in_world(world) \
        ...
        .for_each(...)
    
    # Ideally, the world would not need to be specified
    # and Glecs would infer by the context what world
    # should be used.
    GFSystemBuilder.new() \
        ...
        .for_each(...)

The solution to this needs to be multi-threading safe.

@GsLogiMaker GsLogiMaker added the enhancement New feature or request label Dec 6, 2024
@GsLogiMaker GsLogiMaker mentioned this issue Jan 29, 2025
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant