Commit c40eed7e authored by Chen Bill's avatar Chen Bill Committed by GitHub

add sort.h (#593)

fix struct card_sort::operator()
parent 5dfde49d
...@@ -23,9 +23,7 @@ const std::unordered_map<uint32, uint32> card::second_code = { ...@@ -23,9 +23,7 @@ const std::unordered_map<uint32, uint32> card::second_code = {
{CARD_HERMOS, 10000070u} {CARD_HERMOS, 10000070u}
}; };
bool card_sort::operator()(void* const & p1, void* const & p2) const { bool card_sort::operator()(card* const& c1, card* const& c2) const {
card* c1 = (card*)p1;
card* c2 = (card*)p2;
return c1->cardid < c2->cardid; return c1->cardid < c2->cardid;
} }
bool card_state::is_location(int32 loc) const { bool card_state::is_location(int32 loc) const {
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "common.h" #include "common.h"
#include "effectset.h" #include "effectset.h"
#include "card_data.h" #include "card_data.h"
#include "sort.h"
#include <set> #include <set>
#include <map> #include <map>
#include <unordered_set> #include <unordered_set>
......
...@@ -42,9 +42,6 @@ typedef signed char int8; ...@@ -42,9 +42,6 @@ typedef signed char int8;
#ifndef NULL #ifndef NULL
#define NULL 0 #define NULL 0
#endif #endif
struct card_sort {
bool operator()(void* const & c1, void* const & c2) const;
};
#define CURRENT_RULE 5 #define CURRENT_RULE 5
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#define DUEL_H_ #define DUEL_H_
#include "common.h" #include "common.h"
#include "sort.h"
#include "mtrandom.h" #include "mtrandom.h"
#include <set> #include <set>
#include <unordered_set> #include <unordered_set>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#define GROUP_H_ #define GROUP_H_
#include "common.h" #include "common.h"
#include "sort.h"
#include <set> #include <set>
#include <list> #include <list>
......
#ifndef SORT_H_
#define SORT_H_
class card;
struct card_sort {
bool operator()(card* const& c1, card* const& c2) const;
};
#endif /* SORT_H_ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment