added default constructor to actor
This commit is contained in:
1
TODO
1
TODO
@@ -22,6 +22,5 @@
|
||||
- standard each, use bitmask to speed up the whole thing and avoid accessing the pools to test for the page
|
||||
- iterator based each with a couple of iterators passed from outside (use bitmask + has)
|
||||
* stable component handle that isn't affected by reallocations
|
||||
* default constructor + init/re-init function to actor
|
||||
* multi component registry::remove and some others?
|
||||
* built-in support for dual (or N-) buffering
|
||||
|
||||
@@ -29,6 +29,10 @@ struct basic_actor {
|
||||
/*! @brief Underlying entity identifier. */
|
||||
using entity_type = Entity;
|
||||
|
||||
basic_actor() ENTT_NOEXCEPT
|
||||
: reg{nullptr}, entt{entt::null}
|
||||
{}
|
||||
|
||||
/**
|
||||
* @brief Constructs an actor by using the given registry.
|
||||
* @param ref An entity-component system properly initialized.
|
||||
|
||||
@@ -42,11 +42,16 @@ TEST(Actor, Component) {
|
||||
|
||||
TEST(Actor, EntityLifetime) {
|
||||
entt::registry registry;
|
||||
entt::actor actor{registry};
|
||||
entt::actor actor{};
|
||||
|
||||
ASSERT_FALSE(actor);
|
||||
|
||||
actor = entt::actor{registry};
|
||||
actor.assign<int>();
|
||||
|
||||
ASSERT_TRUE(actor);
|
||||
ASSERT_TRUE(actor);
|
||||
ASSERT_FALSE(registry.empty<int>());
|
||||
ASSERT_FALSE(registry.empty());
|
||||
|
||||
registry.destroy(actor.entity());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user