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

Implement a structured interface for creating entities from C++ scripts #74

Open
ImmutableOctet opened this issue Jul 15, 2024 · 0 comments
Assignees
Labels
C++ Script API Feature New feature or request module: engine For features that involve the `engine` module. (optional)

Comments

@ImmutableOctet
Copy link
Owner

ImmutableOctet commented Jul 15, 2024

Creation would be handled with an awaitable, driven by an event under the hood. -- This event would have a token/UUID obtained automatically for the entity creation request.

Archetype information would be encoded in the creation event, and the event itself would be handled by EntitySystem. Once the initial event is processed, a new event with the generated entity will be created, sending back the original UUID of the request. The script's awaitable would then capture the response event, giving back control.

The creation awaitable may be best implemented by returning a wrapper type holding a 'lock' (#77) on the entity to ensure safety. The lock object could then be destroyed through implicit conversion to Entity if needed, or held as-is.

@ImmutableOctet ImmutableOctet added Feature New feature or request module: engine For features that involve the `engine` module. (optional) C++ Script API labels Jul 15, 2024
@ImmutableOctet ImmutableOctet self-assigned this Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ Script API Feature New feature or request module: engine For features that involve the `engine` module. (optional)
Projects
None yet
Development

No branches or pull requests

1 participant