Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Ndk::EntityList Class Reference

NDK class that represents a set of entities to help performing batch operations. More...

Inherits iterator< std::forward_iterator_tag, const EntityHandle >.

Public Types

using size_type = std::size_t
 

Public Member Functions

 EntityList (const EntityList &entityList)
 
 EntityList (EntityList &&entityList) noexcept
 
void Clear ()
 Clears the set from every entities. More...
 
bool Has (const Entity *entity) const
 Checks whether or not the EntityList contains the entity. More...
 
bool Has (EntityId entity) const
 Checks whether or not the set contains the entity by id. More...
 
void Insert (Entity *entity)
 Inserts the entity into the set. More...
 
void Remove (Entity *entity)
 Removes the entity from the set. More...
 
void Reserve (std::size_t entityCount)
 Reserves enough space to contains entityCount entities. More...
 
iterator begin () const
 
bool empty () const
 
iterator end () const
 
size_type size () const
 
EntityListoperator= (const EntityList &entityList)
 
EntityListoperator= (EntityList &&entityList) noexcept
 
 iterator (const iterator &it)
 
const EntityHandleoperator* () const
 
iterator & operator= (const iterator &it)
 
iterator & operator++ ()
 
iterator operator++ (int)
 

Public Attributes

friend iterator
 

Friends

bool operator== (const iterator &lhs, const iterator &rhs)
 
bool operator!= (const iterator &lhs, const iterator &rhs)
 
void swap (iterator &lhs, iterator &rhs)
 

Detailed Description

NDK class that represents a set of entities to help performing batch operations.

Member Function Documentation

◆ Clear()

void Ndk::EntityList::Clear ( )
inline

Clears the set from every entities.

Remarks
This resets the implicit world member, allowing you to insert entities from a different world than previously

◆ Has() [1/2]

bool Ndk::EntityList::Has ( const Entity entity) const
inline

Checks whether or not the EntityList contains the entity.

Returns
true If it is the case
Parameters
entityPointer to the entity
Remarks
If the Insert function was called since the EntityList construction (or last call to Clear), the entity passed by parameter must belong to the same world as the previously inserted entities.

◆ Has() [2/2]

bool Ndk::EntityList::Has ( EntityId  entity) const
inline

Checks whether or not the set contains the entity by id.

Returns
true If it is the case
Parameters
idIdentifier of the entity

◆ Insert()

void Ndk::EntityList::Insert ( Entity entity)
inline

Inserts the entity into the set.

Marks an entity as present in this entity list, it must belongs to the same world as others entities contained in this list.

Parameters
entityValid pointer to an entity
Remarks
If entity is already contained, no action is performed
If any entity has been inserted since construction (or last Clear call), the entity must belong to the same world as the previously inserted entities

◆ Remove()

void Ndk::EntityList::Remove ( Entity entity)
inline

Removes the entity from the set.

Parameters
entityPointer to the entity
Remarks
If entity is not contained, no action is performed
This function never resets the implicit world member, even if it empties the list. Use the Clear method if you want to reset it.
See also
Clear

◆ Reserve()

void Ndk::EntityList::Reserve ( std::size_t  entityCount)
inline

Reserves enough space to contains entityCount entities.

Parameters
entityCountNumber of entities to reserve

The documentation for this class was generated from the following files: