Core/Flags: Add Set method
This commit is contained in:
@@ -199,6 +199,7 @@ Nazara Engine:
|
||||
- Fixed out-of-bounds access in LuaInstance::LoadLibraries
|
||||
- Add Flags<E>::Clear(Flags) helper method, to clear one or more flags.
|
||||
- Add Flags<E>::Clear() helper method, to reset flags
|
||||
- Add Flags<E>::Set(Flags) helper method, to enable flags
|
||||
|
||||
Nazara Development Kit:
|
||||
- Added ImageWidget (#139)
|
||||
|
||||
@@ -51,6 +51,8 @@ namespace Nz
|
||||
void Clear();
|
||||
void Clear(const Flags& flags);
|
||||
|
||||
void Set(const Flags& flags);
|
||||
|
||||
constexpr bool Test(const Flags& flags) const;
|
||||
|
||||
explicit constexpr operator bool() const;
|
||||
|
||||
@@ -63,6 +63,20 @@ namespace Nz
|
||||
m_value &= ~flags;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Enable some flags
|
||||
*
|
||||
* \param flags Flags to be enabled
|
||||
*
|
||||
* \see Clear
|
||||
* \see Test
|
||||
*/
|
||||
template<typename E>
|
||||
void Flags<E>::Set(const Flags& flags)
|
||||
{
|
||||
m_value |= flags;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Tests if all flags from a Flags object are enabled
|
||||
* \return True if all tested flags are enabled.
|
||||
|
||||
Reference in New Issue
Block a user