ImmutableOctet / glare

Glare: Open Source Game Engine written in Modern C++
MIT License
0 stars 0 forks source link

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

Open ImmutableOctet opened 1 month ago

ImmutableOctet commented 1 month ago

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.