Skip to content

Commit

Permalink
Add AutomapTile#hasAnyFlag
Browse files Browse the repository at this point in the history
For use in #6555
  • Loading branch information
glebm committed Sep 13, 2023
1 parent cf925d1 commit e049bbb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Source/automap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "levels/gendung.h"
#include "levels/setmaps.h"
#include "player.h"
#include "utils/attributes.h"
#include "utils/language.h"
#include "utils/ui_fwd.h"
#include "utils/utf8.hpp"
Expand Down Expand Up @@ -95,6 +96,14 @@ struct AutomapTile {
{
return (static_cast<uint8_t>(flags) & static_cast<uint8_t>(test)) != 0;
}

template <typename... Args>
[[nodiscard]] DVL_ALWAYS_INLINE constexpr bool hasAnyFlag(Flags flag, Args... flags)
{
return (static_cast<uint8_t>(this->flags)
& (static_cast<uint8_t>(flag) | ... | static_cast<uint8_t>(flags)))
!= 0;
}
};

/**
Expand Down

0 comments on commit e049bbb

Please sign in to comment.