Commit 0f6b3dd5 authored by DailyShana's avatar DailyShana

modernize: use using instead of typedef

parent 044311cf
...@@ -94,14 +94,14 @@ public: ...@@ -94,14 +94,14 @@ public:
return std::hash<uint16>()(v.second); return std::hash<uint16>()(v.second);
} }
}; };
typedef std::vector<card*> card_vector; using card_vector = std::vector<card*>;
typedef std::multimap<uint32, effect*> effect_container; using effect_container = std::multimap<uint32, effect*>;
typedef std::set<card*, card_sort> card_set; using card_set = std::set<card*, card_sort>;
typedef std::unordered_map<effect*, effect_container::iterator> effect_indexer; using effect_indexer = std::unordered_map<effect*, effect_container::iterator>;
typedef std::unordered_set<std::pair<effect*, uint16>, effect_relation_hash> effect_relation; using effect_relation = std::unordered_set<std::pair<effect*, uint16>, effect_relation_hash>;
typedef std::unordered_map<card*, uint32> relation_map; using relation_map = std::unordered_map<card*, uint32>;
typedef std::map<uint16, std::array<uint16, 2>> counter_map; using counter_map = std::map<uint16, std::array<uint16, 2>>;
typedef std::map<uint32, int32> effect_count; using effect_count = std::map<uint32, int32>;
class attacker_map : public std::unordered_map<uint16, std::pair<card*, uint32>> { class attacker_map : public std::unordered_map<uint16, std::pair<card*, uint32>> {
public: public:
void addcard(card* pcard); void addcard(card* pcard);
......
...@@ -21,7 +21,7 @@ class interpreter; ...@@ -21,7 +21,7 @@ class interpreter;
class duel { class duel {
public: public:
typedef std::set<card*, card_sort> card_set; using card_set = std::set<card*, card_sort>;
char strbuffer[256]; char strbuffer[256];
byte buffer[0x1000]; byte buffer[0x1000];
uint32 bufferlen; uint32 bufferlen;
......
...@@ -44,7 +44,7 @@ struct optarget { ...@@ -44,7 +44,7 @@ struct optarget {
int32 op_param; int32 op_param;
}; };
struct chain { struct chain {
typedef std::unordered_map<uint32, optarget> opmap; using opmap = std::unordered_map<uint32, optarget>;
uint16 chain_id; uint16 chain_id;
uint8 chain_count; uint8 chain_count;
uint8 triggering_player; uint8 triggering_player;
...@@ -68,7 +68,7 @@ struct chain { ...@@ -68,7 +68,7 @@ struct chain {
}; };
struct player_info { struct player_info {
typedef std::vector<card*> card_vector; using card_vector = std::vector<card*>;
int32 lp; int32 lp;
int32 start_count; int32 start_count;
int32 draw_count; int32 draw_count;
...@@ -88,12 +88,12 @@ struct player_info { ...@@ -88,12 +88,12 @@ struct player_info {
card_vector tag_list_extra; card_vector tag_list_extra;
}; };
struct field_effect { struct field_effect {
typedef std::multimap<uint32, effect*> effect_container; using effect_container = std::multimap<uint32, effect*>;
typedef std::unordered_map<effect*, effect_container::iterator> effect_indexer; using effect_indexer = std::unordered_map<effect*, effect_container::iterator>;
typedef std::unordered_map<effect*, effect*> oath_effects; using oath_effects = std::unordered_map<effect*, effect*>;
typedef std::unordered_set<effect*> effect_collection; using effect_collection = std::unordered_set<effect*>;
typedef std::unordered_map<card*, effect*> gain_effects; using gain_effects = std::unordered_map<card*, effect*>;
typedef std::unordered_map<effect*, gain_effects> grant_effect_container; using grant_effect_container = std::unordered_map<effect*, gain_effects>;
effect_container aura_effect; effect_container aura_effect;
effect_container ignition_effect; effect_container ignition_effect;
...@@ -150,23 +150,23 @@ union return_value { ...@@ -150,23 +150,23 @@ union return_value {
int64 lvalue[8]; int64 lvalue[8];
}; };
struct processor { struct processor {
typedef std::vector<effect*> effect_vector; using effect_vector = std::vector<effect*>;
typedef std::vector<card*> card_vector; using card_vector = std::vector<card*>;
typedef std::vector<uint32> option_vector; using option_vector = std::vector<uint32>;
typedef std::list<card*> card_list; using card_list = std::list<card*>;
typedef std::list<tevent> event_list; using event_list = std::list<tevent>;
typedef std::list<chain> chain_list; using chain_list = std::list<chain>;
typedef std::map<effect*, chain> instant_f_list; using instant_f_list = std::map<effect*, chain>;
typedef std::vector<chain> chain_array; using chain_array = std::vector<chain>;
typedef std::list<processor_unit> processor_list; using processor_list = std::list<processor_unit>;
typedef std::set<card*, card_sort> card_set; using card_set = std::set<card*, card_sort>;
typedef std::set<std::pair<effect*, tevent>> delayed_effect_collection; using delayed_effect_collection = std::set<std::pair<effect*, tevent>>;
struct chain_limit_t { struct chain_limit_t {
chain_limit_t(int32 f, int32 p): function(f), player(p) {} chain_limit_t(int32 f, int32 p): function(f), player(p) {}
int32 function; int32 function;
int32 player; int32 player;
}; };
typedef std::vector<chain_limit_t> chain_limit_list; using chain_limit_list = std::vector<chain_limit_t>;
processor_list units; processor_list units;
processor_list subunits; processor_list subunits;
...@@ -335,16 +335,16 @@ struct processor { ...@@ -335,16 +335,16 @@ struct processor {
}; };
class field { class field {
public: public:
typedef std::multimap<uint32, effect*> effect_container; using effect_container = std::multimap<uint32, effect*>;
typedef std::set<card*, card_sort> card_set; using card_set = std::set<card*, card_sort>;
typedef std::vector<effect*> effect_vector; using effect_vector = std::vector<effect*>;
typedef std::vector<card*> card_vector; using card_vector = std::vector<card*>;
typedef std::list<card*> card_list; using card_list = std::list<card*>;
typedef std::list<tevent> event_list; using event_list = std::list<tevent>;
typedef std::list<chain> chain_list; using chain_list = std::list<chain>;
typedef std::map<effect*, chain> instant_f_list; using instant_f_list = std::map<effect*, chain>;
typedef std::vector<chain> chain_array; using chain_array = std::vector<chain>;
typedef std::list<processor_unit> processor_list; using processor_list = std::list<processor_unit>;
duel* pduel; duel* pduel;
player_info player[2]; player_info player[2];
......
...@@ -17,7 +17,7 @@ class duel; ...@@ -17,7 +17,7 @@ class duel;
class group { class group {
public: public:
typedef std::set<card*, card_sort> card_set; using card_set = std::set<card*, card_sort>;
int32 ref_handle; int32 ref_handle;
duel* pduel; duel* pduel;
card_set container; card_set container;
......
...@@ -26,8 +26,8 @@ class duel; ...@@ -26,8 +26,8 @@ class duel;
class interpreter { class interpreter {
public: public:
typedef std::unordered_map<int32, lua_State*> coroutine_map; using coroutine_map = std::unordered_map<int32, lua_State*>;
typedef std::list<std::pair<void*, uint32>> param_list; using param_list = std::list<std::pair<void*, uint32>>;
duel* pduel; duel* pduel;
char msgbuf[64]; char msgbuf[64];
......
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