Documentation for module 'NDK'
Former-commit-id: 63e1cac538c577a1f1aafa71fa7eef69a6d4daab [formerly b2d8769fd02a0e7d9c476d4ad7be1988a1fd6789] [formerly 636b5cb79bcb8da44d9aa45ba1023565bcf29f0d [formerly a2361ec2b8679d4d4ba096e543b5d4b91825dd62]] Former-commit-id: d402d35477f9db0135c553d55c401939426bf62d [formerly 607336ea0f42731e4604f3a8c2df06f3aecfc401] Former-commit-id: 69e23cd6c06723486de5e4641ce810012dac66da
This commit is contained in:
@@ -6,12 +6,31 @@
|
||||
|
||||
namespace Ndk
|
||||
{
|
||||
/*!
|
||||
* \ingroup NDK
|
||||
* \class Ndk::BaseSystem
|
||||
* \brief NDK class that represents the common base of all systems
|
||||
*
|
||||
* \remark This class is meant to be purely abstract, for type erasure
|
||||
*/
|
||||
|
||||
/*!
|
||||
* \brief Destructs the object and unregisters it-self on every entities
|
||||
*/
|
||||
|
||||
BaseSystem::~BaseSystem()
|
||||
{
|
||||
for (const EntityHandle& entity : m_entities)
|
||||
entity->UnregisterSystem(m_systemIndex);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Checks whether the key of the entity matches the lock of the system
|
||||
* \return true If it is the case
|
||||
*
|
||||
* \param Pointer to the entity
|
||||
*/
|
||||
|
||||
bool BaseSystem::Filters(const Entity* entity) const
|
||||
{
|
||||
if (!entity)
|
||||
@@ -21,13 +40,13 @@ namespace Ndk
|
||||
|
||||
m_filterResult.PerformsAND(m_requiredComponents, components);
|
||||
if (m_filterResult != m_requiredComponents)
|
||||
return false; // Au moins un component requis n'est pas présent
|
||||
return false; // At least one required component is not available
|
||||
|
||||
m_filterResult.PerformsAND(m_excludedComponents, components);
|
||||
if (m_filterResult.TestAny())
|
||||
return false; // Au moins un component exclu est présent
|
||||
return false; // At least one excluded component is available
|
||||
|
||||
// Si nous avons une liste de composants nécessaires
|
||||
// If we have a list of needed components
|
||||
if (m_requiredAnyComponents.TestAny())
|
||||
{
|
||||
if (!m_requiredAnyComponents.Intersects(components))
|
||||
@@ -37,16 +56,35 @@ namespace Ndk
|
||||
return true;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Operation to perform when entity is added to the system
|
||||
*
|
||||
* \param Pointer to the entity
|
||||
*/
|
||||
|
||||
void BaseSystem::OnEntityAdded(Entity* entity)
|
||||
{
|
||||
NazaraUnused(entity);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Operation to perform when entity is removed to the system
|
||||
*
|
||||
* \param Pointer to the entity
|
||||
*/
|
||||
|
||||
void BaseSystem::OnEntityRemoved(Entity* entity)
|
||||
{
|
||||
NazaraUnused(entity);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Operation to perform when entity is validated for the system
|
||||
*
|
||||
* \param entity Pointer to the entity
|
||||
* \param justAdded Is the entity newly added
|
||||
*/
|
||||
|
||||
void BaseSystem::OnEntityValidation(Entity* entity, bool justAdded)
|
||||
{
|
||||
NazaraUnused(entity);
|
||||
|
||||
Reference in New Issue
Block a user