Core/Flags: Add Set method

This commit is contained in:
Lynix 2019-11-09 13:53:29 +01:00
parent a4bff0968b
commit 57958056d6
3 changed files with 17 additions and 0 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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.