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

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