Skip to content

Commit

Permalink
Add card::get_assumed_property
Browse files Browse the repository at this point in the history
Helper function to return a property set by AssumeProperty as std::optional
  • Loading branch information
edo9300 committed Oct 6, 2024
1 parent 243ca65 commit 7912f08
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions card.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define CARD_H_

#include <map>
#include <optional>
#include <set>
#include <unordered_map>
#include <unordered_set>
Expand Down Expand Up @@ -187,6 +188,13 @@ class card : public lua_obj_helper<LuaParam::CARD> {
bool is_extra_deck_monster() const { return !!(data.type & (TYPE_FUSION | TYPE_SYNCHRO | TYPE_XYZ | TYPE_LINK)) && !!(data.type & TYPE_MONSTER); }

void get_infos(uint32_t query_flag);
std::optional<uint64_t> get_assumed_property(uint32_t assume_type) const {
auto assumed = assume.find(assume_type);
if(assumed != assume.end()) {
return assumed->second;
}
return std::nullopt;
}
int32_t is_related_to_chains();
loc_info get_info_location();
uint32_t second_code(uint32_t code);
Expand Down

0 comments on commit 7912f08

Please sign in to comment.