Skip to content

Commit

Permalink
card: reorder static function
Browse files Browse the repository at this point in the history
  • Loading branch information
salix5 committed Nov 17, 2024
1 parent 7e1801e commit 79a5fbc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions card.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ bool card::card_operation_sort(card* c1, card* c2) {
return c1->current.sequence < c2->current.sequence;
}
}
bool card::check_card_setcode(uint32 code, uint32 value) {
card_data dat;
::read_card(code, &dat);
return dat.is_setcode(value);
}
void card::attacker_map::addcard(card* pcard) {
auto fid = pcard ? pcard->fieldid_r : 0;
auto pr = emplace(fid, std::make_pair(pcard, 0));
Expand Down Expand Up @@ -488,11 +493,6 @@ inline bool check_setcode(uint16_t setcode, uint32 value) {
uint32 setsubtype = value & 0xf000U;
return (setcode & 0x0fffU) == settype && (setcode & 0xf000U & setsubtype) == setsubtype;
}
bool card::check_card_setcode(uint32 code, uint32 value) {
card_data dat;
::read_card(code, &dat);
return dat.is_setcode(value);
}
int32 card::is_set_card(uint32 set_code) {
uint32 code1 = get_code();
card_data dat1;
Expand Down
2 changes: 1 addition & 1 deletion card.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ class card {
explicit card(duel* pd);
~card() = default;
static bool card_operation_sort(card* c1, card* c2);
static bool check_card_setcode(uint32 code, uint32 value);
bool is_extra_deck_monster() const { return !!(data.type & TYPES_EXTRA_DECK); }

int32 get_infos(byte* buf, uint32 query_flag, int32 use_cache = TRUE);
Expand All @@ -227,7 +228,6 @@ class card {
std::tuple<uint32, uint32> get_original_code_rule() const;
uint32 get_code();
uint32 get_another_code();
static bool check_card_setcode(uint32 code, uint32 value);
int32 is_set_card(uint32 set_code);
int32 is_origin_set_card(uint32 set_code);
int32 is_pre_set_card(uint32 set_code);
Expand Down

0 comments on commit 79a5fbc

Please sign in to comment.