Core/Flags: Add Set method
This commit is contained in:
@@ -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