Add some ECS API todo's
This commit is contained in:
parent
85c0c56e03
commit
e16ebb8822
1 changed files with 37 additions and 0 deletions
|
|
@ -19,6 +19,13 @@ namespace psemek::ecs
|
||||||
{
|
{
|
||||||
|
|
||||||
using query_cache = std::shared_ptr<detail::query_cache>;
|
using query_cache = std::shared_ptr<detail::query_cache>;
|
||||||
|
using registration_token = std::shared_ptr<void>;
|
||||||
|
|
||||||
|
// TODO:
|
||||||
|
// - Modification callbacks API
|
||||||
|
// - Modification callbacks implementation
|
||||||
|
// - Index API
|
||||||
|
// - Index implementation
|
||||||
|
|
||||||
struct entity_container
|
struct entity_container
|
||||||
{
|
{
|
||||||
|
|
@ -141,6 +148,36 @@ namespace psemek::ecs
|
||||||
template <typename ... Components, typename Function>
|
template <typename ... Components, typename Function>
|
||||||
void batch_apply(Function && function, query_cache cache = {});
|
void batch_apply(Function && function, query_cache cache = {});
|
||||||
|
|
||||||
|
/** Register a constructor. Each time an entity is created that has
|
||||||
|
* the specified set of components (including attaching components),
|
||||||
|
* the constructor is called for this entity immediately after
|
||||||
|
* it is created.
|
||||||
|
* The constructor function must have the same signature as a function
|
||||||
|
* passed to the `apply<Components...>()` call.
|
||||||
|
* The returned value is an ownerwhip token. Destroying it removes
|
||||||
|
* the constructor from the entity_container.
|
||||||
|
* If any two of the passed component types are equal, the call fails with
|
||||||
|
* a compilation error.
|
||||||
|
*/
|
||||||
|
// TODO: implement
|
||||||
|
template <typename ... Components, typename Function>
|
||||||
|
registration_token constructor(Function && function);
|
||||||
|
|
||||||
|
/** Register a destructor. Each time an entity is destroyed that has
|
||||||
|
* the specified set of components (including detaching components),
|
||||||
|
* the destructor is called for this entity immediately before
|
||||||
|
* it will be destroyed.
|
||||||
|
* The destructor function must have the same signature as a function
|
||||||
|
* passed to the `apply<Components...>()` call.
|
||||||
|
* The returned value is an ownerwhip token. Destroying it removes
|
||||||
|
* the destructor from the entity_container.
|
||||||
|
* If any two of the passed component types are equal, the call fails with
|
||||||
|
* a compilation error.
|
||||||
|
*/
|
||||||
|
// TODO: implement
|
||||||
|
template <typename ... Components, typename Function>
|
||||||
|
registration_token destructor(Function && function);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
detail::entity_list entity_list_;
|
detail::entity_list entity_list_;
|
||||||
detail::table_container table_container_;
|
detail::table_container table_container_;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue