Add a few debug assertions to ecs::container
This commit is contained in:
parent
e28a78166e
commit
d09bd76a14
1 changed files with 3 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#include <psemek/ecs/container.hpp>
|
||||
#include <psemek/util/assert.hpp>
|
||||
|
||||
namespace psemek::ecs
|
||||
{
|
||||
|
|
@ -10,12 +11,14 @@ namespace psemek::ecs
|
|||
|
||||
void container::destroy(handle const & entity)
|
||||
{
|
||||
assert(alive(entity));
|
||||
do_destroy(entity);
|
||||
entity_list_.destroy(entity.id);
|
||||
}
|
||||
|
||||
accessor container::get(handle const & entity)
|
||||
{
|
||||
assert(alive(entity));
|
||||
auto const data = entity_list_.get_entities()[entity.id];
|
||||
return {data.table, data.row};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue