|
CeresEngine 0.2.0
A game development framework
|
A object that manages a set of components masks. More...
#include <CeresEngine/Entity/Component.hpp>
Public Member Functions | |
| const ComponentMask & | get (const EntityIndex index) const noexcept |
Gets the current component mask for the given index. | |
| bool | has (const EntityIndex index, const ComponentMask &mask) const noexcept |
Checks if the entity at the given index contains all components in the given mask. | |
| const ComponentMask & | set (const EntityIndex index, const ComponentMask &mask) noexcept |
Sets a mask for the given index. | |
| const ComponentMask & | reset (const EntityIndex index) noexcept |
Removes all bits in the component mask of the given index. | |
| const ComponentMask & | add (const EntityIndex index, const ComponentMask &mask) noexcept |
Adds a new set of components in the given mask to the given index. | |
| const ComponentMask & | remove (const EntityIndex index, const ComponentMask &mask) noexcept |
Removes a new set of components in the given mask from the given index. | |
| std::size_t | getSize () const noexcept |
Private Attributes | |
| Vector< ComponentMask > | mComponentMasks |
| A vector that stores the component masks indexed by an integer index. | |
Static Private Attributes | |
| static constexpr ComponentMask | emptyComponentMask = 0 |
| A default empty component mask used when returning an empty mask by reference. | |
A object that manages a set of components masks.
|
inlinenoexcept |
Adds a new set of components in the given mask to the given index.
| index | The index whose component mask should be updated by adding all bits in mask. |
| mask | The mask whose bits should be enabled. For any bits that are already enabled before calling this method they remain enabled. |
index.
|
inlinenoexcept |
Gets the current component mask for the given index.
If no such mask exists for the given index, an empty mask is returned.
| index | The entity index to retrieve the component mask for. |
|
inlinenoexcept |
|
inlinenoexcept |
Checks if the entity at the given index contains all components in the given mask.
If no such mask exists for the given index, false is returned.
| index | The entity index whose component mask is to be checked against. |
| mask | The component mask to be checked. All components in the mask must be present for this function to return true. |
index mask has all components in mask.
|
inlinenoexcept |
Removes a new set of components in the given mask from the given index.
| index | The index whose component mask should be updated by removing all bits in mask. |
| mask | The mask whose bits should be disabled. For any bits that are not already enabled before calling this method they remain disabled. |
index.
|
inlinenoexcept |
Removes all bits in the component mask of the given index.
| index | The index whose component mask should be reset to all bits being off. |
index.
|
inlinenoexcept |
Sets a mask for the given index.
| index | The index to set a mask for. The internal storage will be automatically resized to fit. |
| mask | The mask to be set. |
index.
|
inlinestaticconstexprprivate |
A default empty component mask used when returning an empty mask by reference.
|
private |
A vector that stores the component masks indexed by an integer index.