Commit b62ac6b3 authored by VanillaSalt's avatar VanillaSalt

remove using namespace std

parent 85d2b687
...@@ -1075,11 +1075,11 @@ int32 card::add_effect(effect* peffect) { ...@@ -1075,11 +1075,11 @@ int32 card::add_effect(effect* peffect) {
remove_effect(rm->second); remove_effect(rm->second);
} }
} }
it = single_effect.insert(make_pair(peffect->code, peffect)); it = single_effect.insert(std::make_pair(peffect->code, peffect));
} else if (peffect->type & EFFECT_TYPE_FIELD) } else if (peffect->type & EFFECT_TYPE_FIELD)
it = field_effect.insert(make_pair(peffect->code, peffect)); it = field_effect.insert(std::make_pair(peffect->code, peffect));
else if (peffect->type & EFFECT_TYPE_EQUIP) { else if (peffect->type & EFFECT_TYPE_EQUIP) {
it = equip_effect.insert(make_pair(peffect->code, peffect)); it = equip_effect.insert(std::make_pair(peffect->code, peffect));
if (equiping_target) if (equiping_target)
check_target = equiping_target; check_target = equiping_target;
else else
...@@ -1102,7 +1102,7 @@ int32 card::add_effect(effect* peffect) { ...@@ -1102,7 +1102,7 @@ int32 card::add_effect(effect* peffect) {
if((peffect->reset_count & 0xff) > (pduel->game_field->core.reason_effect->reset_count & 0xff)) if((peffect->reset_count & 0xff) > (pduel->game_field->core.reason_effect->reset_count & 0xff))
peffect->reset_count = (peffect->reset_count & 0xffffff00) | (pduel->game_field->core.reason_effect->reset_count & 0xff); peffect->reset_count = (peffect->reset_count & 0xffffff00) | (pduel->game_field->core.reason_effect->reset_count & 0xff);
} }
indexer.insert(make_pair(peffect, it)); indexer.insert(std::make_pair(peffect, it));
peffect->handler = this; peffect->handler = this;
if((peffect->type & 0x7e0) if((peffect->type & 0x7e0)
|| (pduel->game_field->core.reason_effect && (pduel->game_field->core.reason_effect->status & EFFECT_STATUS_ACTIVATED))) || (pduel->game_field->core.reason_effect && (pduel->game_field->core.reason_effect->status & EFFECT_STATUS_ACTIVATED)))
...@@ -1115,7 +1115,7 @@ int32 card::add_effect(effect* peffect) { ...@@ -1115,7 +1115,7 @@ int32 card::add_effect(effect* peffect) {
} }
if(peffect->is_flag(EFFECT_FLAG_OATH)) { if(peffect->is_flag(EFFECT_FLAG_OATH)) {
effect* reason_effect = pduel->game_field->core.reason_effect; effect* reason_effect = pduel->game_field->core.reason_effect;
pduel->game_field->effects.oath.insert(make_pair(peffect, reason_effect)); pduel->game_field->effects.oath.insert(std::make_pair(peffect, reason_effect));
} }
if(peffect->reset_flag & RESET_PHASE) { if(peffect->reset_flag & RESET_PHASE) {
pduel->game_field->effects.pheff.insert(peffect); pduel->game_field->effects.pheff.insert(peffect);
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
#include <vector> #include <vector>
#include <map> #include <map>
using namespace std;
class card; class card;
class duel; class duel;
class group; class group;
......
...@@ -729,29 +729,29 @@ void field::add_effect(effect* peffect, uint8 owner_player) { ...@@ -729,29 +729,29 @@ void field::add_effect(effect* peffect, uint8 owner_player) {
peffect->card_type = peffect->owner->data.type; peffect->card_type = peffect->owner->data.type;
effect_container::iterator it; effect_container::iterator it;
if (!(peffect->type & EFFECT_TYPE_ACTIONS)) { if (!(peffect->type & EFFECT_TYPE_ACTIONS)) {
it = effects.aura_effect.insert(make_pair(peffect->code, peffect)); it = effects.aura_effect.insert(std::make_pair(peffect->code, peffect));
if(peffect->code == EFFECT_SPSUMMON_COUNT_LIMIT) if(peffect->code == EFFECT_SPSUMMON_COUNT_LIMIT)
effects.spsummon_count_eff.insert(peffect); effects.spsummon_count_eff.insert(peffect);
} else { } else {
if (peffect->type & EFFECT_TYPE_IGNITION) if (peffect->type & EFFECT_TYPE_IGNITION)
it = effects.ignition_effect.insert(make_pair(peffect->code, peffect)); it = effects.ignition_effect.insert(std::make_pair(peffect->code, peffect));
else if (peffect->type & EFFECT_TYPE_ACTIVATE) else if (peffect->type & EFFECT_TYPE_ACTIVATE)
it = effects.activate_effect.insert(make_pair(peffect->code, peffect)); it = effects.activate_effect.insert(std::make_pair(peffect->code, peffect));
else if (peffect->type & EFFECT_TYPE_TRIGGER_O && peffect->type & EFFECT_TYPE_FIELD) else if (peffect->type & EFFECT_TYPE_TRIGGER_O && peffect->type & EFFECT_TYPE_FIELD)
it = effects.trigger_o_effect.insert(make_pair(peffect->code, peffect)); it = effects.trigger_o_effect.insert(std::make_pair(peffect->code, peffect));
else if (peffect->type & EFFECT_TYPE_TRIGGER_F && peffect->type & EFFECT_TYPE_FIELD) else if (peffect->type & EFFECT_TYPE_TRIGGER_F && peffect->type & EFFECT_TYPE_FIELD)
it = effects.trigger_f_effect.insert(make_pair(peffect->code, peffect)); it = effects.trigger_f_effect.insert(std::make_pair(peffect->code, peffect));
else if (peffect->type & EFFECT_TYPE_QUICK_O) else if (peffect->type & EFFECT_TYPE_QUICK_O)
it = effects.quick_o_effect.insert(make_pair(peffect->code, peffect)); it = effects.quick_o_effect.insert(std::make_pair(peffect->code, peffect));
else if (peffect->type & EFFECT_TYPE_QUICK_F) else if (peffect->type & EFFECT_TYPE_QUICK_F)
it = effects.quick_f_effect.insert(make_pair(peffect->code, peffect)); it = effects.quick_f_effect.insert(std::make_pair(peffect->code, peffect));
else if (peffect->type & EFFECT_TYPE_CONTINUOUS) else if (peffect->type & EFFECT_TYPE_CONTINUOUS)
it = effects.continuous_effect.insert(make_pair(peffect->code, peffect)); it = effects.continuous_effect.insert(std::make_pair(peffect->code, peffect));
} }
effects.indexer.insert(make_pair(peffect, it)); effects.indexer.insert(std::make_pair(peffect, it));
if((peffect->is_flag(EFFECT_FLAG_FIELD_ONLY))) { if((peffect->is_flag(EFFECT_FLAG_FIELD_ONLY))) {
if(peffect->is_flag(EFFECT_FLAG_OATH)) if(peffect->is_flag(EFFECT_FLAG_OATH))
effects.oath.insert(make_pair(peffect, core.reason_effect)); effects.oath.insert(std::make_pair(peffect, core.reason_effect));
if(peffect->reset_flag & RESET_PHASE) if(peffect->reset_flag & RESET_PHASE)
effects.pheff.insert(peffect); effects.pheff.insert(peffect);
if(peffect->reset_flag & RESET_CHAIN) if(peffect->reset_flag & RESET_CHAIN)
...@@ -2165,8 +2165,7 @@ int32 field::is_player_can_place_counter(uint8 playerid, card * pcard, uint16 co ...@@ -2165,8 +2165,7 @@ int32 field::is_player_can_place_counter(uint8 playerid, card * pcard, uint16 co
int32 field::is_player_can_remove_counter(uint8 playerid, card * pcard, uint8 s, uint8 o, uint16 countertype, uint16 count, uint32 reason) { int32 field::is_player_can_remove_counter(uint8 playerid, card * pcard, uint8 s, uint8 o, uint16 countertype, uint16 count, uint32 reason) {
if((pcard && pcard->get_counter(countertype) >= count) || (!pcard && get_field_counter(playerid, s, o, countertype) >= count)) if((pcard && pcard->get_counter(countertype) >= count) || (!pcard && get_field_counter(playerid, s, o, countertype) >= count))
return TRUE; return TRUE;
pair<effect_container::iterator, effect_container::iterator> pr; auto pr = effects.continuous_effect.equal_range(EFFECT_RCOUNTER_REPLACE + countertype);
pr = effects.continuous_effect.equal_range(EFFECT_RCOUNTER_REPLACE + countertype);
effect* peffect; effect* peffect;
tevent e; tevent e;
e.event_cards = 0; e.event_cards = 0;
...@@ -2185,8 +2184,7 @@ int32 field::is_player_can_remove_counter(uint8 playerid, card * pcard, uint8 s, ...@@ -2185,8 +2184,7 @@ int32 field::is_player_can_remove_counter(uint8 playerid, card * pcard, uint8 s,
int32 field::is_player_can_remove_overlay_card(uint8 playerid, card * pcard, uint8 s, uint8 o, uint16 min, uint32 reason) { int32 field::is_player_can_remove_overlay_card(uint8 playerid, card * pcard, uint8 s, uint8 o, uint16 min, uint32 reason) {
if((pcard && pcard->xyz_materials.size() >= min) || (!pcard && get_overlay_count(playerid, s, o) >= min)) if((pcard && pcard->xyz_materials.size() >= min) || (!pcard && get_overlay_count(playerid, s, o) >= min))
return TRUE; return TRUE;
pair<effect_container::iterator, effect_container::iterator> pr; auto pr = effects.continuous_effect.equal_range(EFFECT_OVERLAY_REMOVE_REPLACE);
pr = effects.continuous_effect.equal_range(EFFECT_OVERLAY_REMOVE_REPLACE);
effect* peffect; effect* peffect;
tevent e; tevent e;
e.event_cards = 0; e.event_cards = 0;
......
...@@ -677,15 +677,15 @@ int32 interpreter::load_card_script(uint32 code) { ...@@ -677,15 +677,15 @@ int32 interpreter::load_card_script(uint32 code) {
} }
void interpreter::add_param(void *param, int32 type, bool front) { void interpreter::add_param(void *param, int32 type, bool front) {
if(front) if(front)
params.push_front(make_pair(param, type)); params.push_front(std::make_pair(param, type));
else else
params.push_back(make_pair(param, type)); params.push_back(std::make_pair(param, type));
} }
void interpreter::add_param(ptr param, int32 type, bool front) { void interpreter::add_param(ptr param, int32 type, bool front) {
if(front) if(front)
params.push_front(make_pair((void*)param, type)); params.push_front(std::make_pair((void*)param, type));
else else
params.push_back(make_pair((void*)param, type)); params.push_back(std::make_pair((void*)param, type));
} }
void interpreter::push_param(lua_State* L, bool is_coroutine) { void interpreter::push_param(lua_State* L, bool is_coroutine) {
uint32 type; uint32 type;
...@@ -1020,7 +1020,7 @@ int32 interpreter::call_coroutine(int32 f, uint32 param_count, uint32 * yield_va ...@@ -1020,7 +1020,7 @@ int32 interpreter::call_coroutine(int32 f, uint32 param_count, uint32 * yield_va
return OPERATION_FAIL; return OPERATION_FAIL;
} }
call_depth++; call_depth++;
coroutines.insert(make_pair(f, rthread)); coroutines.insert(std::make_pair(f, rthread));
} else { } else {
rthread = it->second; rthread = it->second;
if(step == 0) { if(step == 0) {
......
...@@ -601,8 +601,7 @@ int32 field::remove_counter(uint16 step, uint32 reason, card* pcard, uint8 rplay ...@@ -601,8 +601,7 @@ int32 field::remove_counter(uint16 step, uint32 reason, card* pcard, uint8 rplay
core.select_options.push_back(10); core.select_options.push_back(10);
core.select_effects.push_back(0); core.select_effects.push_back(0);
} }
pair<effect_container::iterator, effect_container::iterator> pr; auto pr = effects.continuous_effect.equal_range(EFFECT_RCOUNTER_REPLACE + countertype);
pr = effects.continuous_effect.equal_range(EFFECT_RCOUNTER_REPLACE + countertype);
effect* peffect; effect* peffect;
tevent e; tevent e;
e.event_cards = 0; e.event_cards = 0;
......
...@@ -1940,7 +1940,6 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free ...@@ -1940,7 +1940,6 @@ int32 field::process_point_event(int16 step, int32 skip_trigger, int32 skip_free
return TRUE; return TRUE;
} }
int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priority) { int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priority) {
pair<effect_container::iterator, effect_container::iterator> pr;
event_list::iterator evit; event_list::iterator evit;
effect* peffect; effect* peffect;
switch(step) { switch(step) {
...@@ -2018,7 +2017,7 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori ...@@ -2018,7 +2017,7 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
pev = false; pev = false;
} }
while(pev || (evit != core.instant_event.end())) { while(pev || (evit != core.instant_event.end())) {
pr = effects.activate_effect.equal_range(evit->event_code); auto pr = effects.activate_effect.equal_range(evit->event_code);
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
peffect->s_range = peffect->handler->current.location; peffect->s_range = peffect->handler->current.location;
...@@ -2033,8 +2032,8 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori ...@@ -2033,8 +2032,8 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
newchain.triggering_sequence = peffect->handler->current.sequence; newchain.triggering_sequence = peffect->handler->current.sequence;
newchain.triggering_player = priority; newchain.triggering_player = priority;
core.select_chains.push_back(newchain); core.select_chains.push_back(newchain);
core.delayed_quick_tmp.erase(make_pair(peffect, *evit)); core.delayed_quick_tmp.erase(std::make_pair(peffect, *evit));
core.delayed_quick_break.erase(make_pair(peffect, *evit)); core.delayed_quick_break.erase(std::make_pair(peffect, *evit));
} }
} }
pr = effects.quick_o_effect.equal_range(evit->event_code); pr = effects.quick_o_effect.equal_range(evit->event_code);
...@@ -2052,8 +2051,8 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori ...@@ -2052,8 +2051,8 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
newchain.triggering_sequence = peffect->handler->current.sequence; newchain.triggering_sequence = peffect->handler->current.sequence;
newchain.triggering_player = priority; newchain.triggering_player = priority;
core.select_chains.push_back(newchain); core.select_chains.push_back(newchain);
core.delayed_quick_tmp.erase(make_pair(peffect, *evit)); core.delayed_quick_tmp.erase(std::make_pair(peffect, *evit));
core.delayed_quick_break.erase(make_pair(peffect, *evit)); core.delayed_quick_break.erase(std::make_pair(peffect, *evit));
} }
} }
++evit; ++evit;
...@@ -2109,7 +2108,7 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori ...@@ -2109,7 +2108,7 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
core.spe_effect[priority] = core.select_chains.size(); core.spe_effect[priority] = core.select_chains.size();
if(!skip_freechain) { if(!skip_freechain) {
nil_event.event_code = EVENT_FREE_CHAIN; nil_event.event_code = EVENT_FREE_CHAIN;
pr = effects.activate_effect.equal_range(EVENT_FREE_CHAIN); auto pr = effects.activate_effect.equal_range(EVENT_FREE_CHAIN);
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
peffect->s_range = peffect->handler->current.location; peffect->s_range = peffect->handler->current.location;
...@@ -2168,7 +2167,7 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori ...@@ -2168,7 +2167,7 @@ int32 field::process_quick_effect(int16 step, int32 skip_freechain, uint8 priori
chain newchain = core.select_chains[returns.ivalue[0]]; chain newchain = core.select_chains[returns.ivalue[0]];
core.new_chains.push_back(newchain); core.new_chains.push_back(newchain);
effect* peffect = newchain.triggering_effect; effect* peffect = newchain.triggering_effect;
core.delayed_quick.erase(make_pair(peffect, newchain.evt)); core.delayed_quick.erase(std::make_pair(peffect, newchain.evt));
peffect->handler->set_status(STATUS_CHAINING, TRUE); peffect->handler->set_status(STATUS_CHAINING, TRUE);
peffect->dec_count(priority); peffect->dec_count(priority);
add_process(PROCESSOR_ADD_CHAIN, 0, 0, 0, 0, 0); add_process(PROCESSOR_ADD_CHAIN, 0, 0, 0, 0, 0);
...@@ -2303,13 +2302,13 @@ int32 field::process_instant_event() { ...@@ -2303,13 +2302,13 @@ int32 field::process_instant_event() {
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
if((peffect->is_flag(EFFECT_FLAG_DELAY)) && peffect->is_condition_check(peffect->handler->current.controler, *elit)) if((peffect->is_flag(EFFECT_FLAG_DELAY)) && peffect->is_condition_check(peffect->handler->current.controler, *elit))
core.delayed_quick_tmp.insert(make_pair(peffect, *elit)); core.delayed_quick_tmp.insert(std::make_pair(peffect, *elit));
} }
pr = effects.quick_o_effect.equal_range(elit->event_code); pr = effects.quick_o_effect.equal_range(elit->event_code);
for(; pr.first != pr.second; ++pr.first) { for(; pr.first != pr.second; ++pr.first) {
peffect = pr.first->second; peffect = pr.first->second;
if((peffect->is_flag(EFFECT_FLAG_DELAY)) && peffect->is_condition_check(peffect->handler->current.controler, *elit)) if((peffect->is_flag(EFFECT_FLAG_DELAY)) && peffect->is_condition_check(peffect->handler->current.controler, *elit))
core.delayed_quick_tmp.insert(make_pair(peffect, *elit)); core.delayed_quick_tmp.insert(std::make_pair(peffect, *elit));
} }
} }
for(eit = tp.begin(), evit = tev.begin(); eit != tp.end(); ++eit, ++evit) { for(eit = tp.begin(), evit = tev.begin(); eit != tp.end(); ++eit, ++evit) {
......
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