Commit 36e4dfe5 authored by Chen Bill's avatar Chen Bill

ClientField: member initialization

parent d71ff122
......@@ -11,26 +11,6 @@
namespace ygo {
ClientField::ClientField() {
panel = 0;
hovered_card = 0;
clicked_card = 0;
highlighting_card = 0;
menu_card = 0;
hovered_controler = 0;
hovered_location = 0;
hovered_sequence = 0;
selectable_field = 0;
selected_field = 0;
deck_act = false;
grave_act = false;
remove_act = false;
extra_act = false;
pzone_act[0] = false;
pzone_act[1] = false;
conti_act = false;
deck_reversed = false;
conti_selecting = false;
cant_check_grave = false;
for(int p = 0; p < 2; ++p) {
mzone[p].resize(7, 0);
szone[p].resize(8, 0);
......
......@@ -33,6 +33,7 @@ public:
std::vector<ClientCard*> remove[2];
std::vector<ClientCard*> extra[2];
std::set<ClientCard*> overlay_cards;
std::vector<ClientCard*> summonable_cards;
std::vector<ClientCard*> spsummonable_cards;
std::vector<ClientCard*> msetable_cards;
......@@ -45,25 +46,25 @@ public:
std::vector<int> select_options;
std::vector<int> select_options_index;
std::vector<ChainInfo> chains;
int extra_p_count[2];
int extra_p_count[2]{ 0 };
size_t selected_option;
ClientCard* attacker;
ClientCard* attack_target;
unsigned int disabled_field;
unsigned int selectable_field;
unsigned int selected_field;
int select_min;
int select_max;
int must_select_count;
int select_sumval;
int select_mode;
bool select_cancelable;
bool select_panalmode;
bool select_ready;
int announce_count;
int select_counter_count;
int select_counter_type;
size_t selected_option{ 0 };
ClientCard* attacker{ nullptr };
ClientCard* attack_target{ nullptr };
unsigned int disabled_field{ 0 };
unsigned int selectable_field{ 0 };
unsigned int selected_field{ 0 };
int select_min{ 0 };
int select_max{ 0 };
int must_select_count{ 0 };
int select_sumval{ 0 };
int select_mode{ 0 };
bool select_cancelable{ false };
bool select_panalmode{ false };
bool select_ready{ false };
int announce_count{ 0 };
int select_counter_count{ 0 };
int select_counter_type{ 0 };
std::vector<ClientCard*> selectable_cards;
std::vector<ClientCard*> selected_cards;
std::set<ClientCard*> selectsum_cards;
......@@ -72,18 +73,18 @@ public:
std::vector<ClientCard*> display_cards;
std::vector<int> sort_list;
std::map<int, int> player_desc_hints[2];
bool grave_act;
bool remove_act;
bool deck_act;
bool extra_act;
bool pzone_act[2];
bool conti_act;
bool chain_forced;
bool grave_act{ false };
bool remove_act{ false };
bool deck_act{ false };
bool extra_act{ false };
bool pzone_act[2]{ false };
bool conti_act{ false };
bool chain_forced{ false };
ChainInfo current_chain;
bool last_chain;
bool deck_reversed;
bool conti_selecting;
bool cant_check_grave;
bool last_chain{ false };
bool deck_reversed{ false };
bool conti_selecting{ false };
bool cant_check_grave{ false };
mt19937 rnd;
ClientField();
......@@ -121,21 +122,21 @@ public:
void UpdateDeclarableList();
irr::gui::IGUIElement* panel;
irr::gui::IGUIElement* panel{ nullptr };
std::vector<int> ancard;
int hovered_controler;
int hovered_location;
size_t hovered_sequence;
int command_controler;
int command_location;
size_t command_sequence;
ClientCard* hovered_card;
int hovered_player;
ClientCard* clicked_card;
ClientCard* command_card;
ClientCard* highlighting_card;
ClientCard* menu_card;
int list_command;
int hovered_controler{ 0 };
int hovered_location{ 0 };
size_t hovered_sequence{ 0 };
int command_controler{ 0 };
int command_location{ 0 };
size_t command_sequence{ 0 };
ClientCard* hovered_card{ nullptr };
int hovered_player{ 0 };
ClientCard* clicked_card{ nullptr };
ClientCard* command_card{ nullptr };
ClientCard* highlighting_card{ nullptr };
ClientCard* menu_card{ nullptr };
int list_command{ 0 };
virtual bool OnEvent(const irr::SEvent& event);
virtual bool OnCommonEvent(const irr::SEvent& event);
......
......@@ -2525,7 +2525,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
int appear = mainGame->gameConf.quick_animation ? 12 : 20;
if (pl == 0) {
ClientCard* pcard = new ClientCard();
ClientCard* pcard = new ClientCard;
pcard->position = cp;
pcard->SetCode(code);
if(!mainGame->dInfo.isReplay || !mainGame->dInfo.isReplaySkiping) {
......@@ -3744,7 +3744,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
} else {
while(mainGame->dField.deck[player].size() < mcount) {
ClientCard* ccard = new ClientCard();
ClientCard* ccard = new ClientCard;
ccard->controler = player;
ccard->location = LOCATION_DECK;
ccard->sequence = mainGame->dField.deck[player].size();
......@@ -3759,7 +3759,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
} else {
while(mainGame->dField.hand[player].size() < hcount) {
ClientCard* ccard = new ClientCard();
ClientCard* ccard = new ClientCard;
ccard->controler = player;
ccard->location = LOCATION_HAND;
ccard->sequence = mainGame->dField.hand[player].size();
......@@ -3774,7 +3774,7 @@ int DuelClient::ClientAnalyze(unsigned char* msg, unsigned int len) {
}
} else {
while(mainGame->dField.extra[player].size() < ecount) {
ClientCard* ccard = new ClientCard();
ClientCard* ccard = new ClientCard;
ccard->controler = player;
ccard->location = LOCATION_EXTRA;
ccard->sequence = mainGame->dField.extra[player].size();
......
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