diff --git a/src/openrct2/core/FlagHolder.hpp b/src/openrct2/core/FlagHolder.hpp index b8d443c970..a63ac37620 100644 --- a/src/openrct2/core/FlagHolder.hpp +++ b/src/openrct2/core/FlagHolder.hpp @@ -67,6 +67,22 @@ struct FlagHolder holder |= EnumsToFlags(types...); } + template + constexpr FlagHolder with(TTypes... types) + { + FlagHolder res = *this; + res.set(types...); + return res; + } + + template + constexpr FlagHolder without(TTypes... types) + { + FlagHolder res = *this; + res.unset(types...); + return res; + } + /** * For situations where you don’t know upfront whether to set or unset the flag, * e.g. in game actions where this is passed as a variable.