Index: /code/branches/wagnis_HS18/data/levels/Wagnis_testlevel.oxw
===================================================================
--- /code/branches/wagnis_HS18/data/levels/Wagnis_testlevel.oxw (revision 12159)
+++ /code/branches/wagnis_HS18/data/levels/Wagnis_testlevel.oxw (revision 12160)
@@ -32,5 +32,5 @@
-
+
@@ -100,5 +100,5 @@
-
+
@@ -109,5 +109,5 @@
-
+
@@ -122,13 +122,4 @@
-
-
-
-
-
-
-
-
-
Index: /code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.cc
===================================================================
--- /code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.cc (revision 12159)
+++ /code/branches/wagnis_HS18/src/modules/wagnis/Wagnis.cc (revision 12160)
@@ -64,4 +64,6 @@
**/
void Wagnis::playerFinishedStageCallback(WagnisPlayer* player){
+
+ player->resetProvinceSelection();
if(this->active_player != player->Player_ID){
@@ -132,4 +134,5 @@
player->gameStage = ATTACK_STAGE;
this->gameStage = ATTACK_STAGE;
+ player->reinforcements = provincesOfPlayerCounter(player->Player_ID);
orxout()<<"Player "<Player_ID<<"\'s turn. Attack."<gameBoard->initializeNeighbors();
-
- //for(WagnisPlayer* p: this->players){
- //this->playerEntered(p);
- //}
+ this->gameBoard->initializeNeighbors();
orxout() << "Game creation finished" << endl;
@@ -198,5 +197,5 @@
}
}else{
- orxout()<<"Nullpointer found in provines!!!"<getID() == other_ID){
orig->addNeighbor(other);
- orxout() << "Added neighbor province "<< other_ID << " to province " << origin_ID << endl;
+ //orxout() << "Added neighbor province "<< other_ID << " to province " << origin_ID << endl;
break;
}
}
}
- break;
}
}while((n < str.size()) && (str[n] == '+'));
+
if(n == str.size()) return;
while((n < str.size()) && (str[n] == ' ')) n++;
@@ -102,4 +103,5 @@
n++;
while(n < str.size() && str[n] == ' ') n++;
+ orxout()<<"One province finished"<active_player<<" place your reinforcements";
+ ss<<"Player "<active_player<<" place your reinforcements: "<players.at(wagnisgame->active_player-1)->reinforcements;
setCaption( ss.str() );
break;
Index: /code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc
===================================================================
--- /code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc (revision 12159)
+++ /code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc (revision 12160)
@@ -47,5 +47,7 @@
this->province_selection_changed = true;
}else{
+ if(this->origin_province != nullptr) this->origin_province->dehighlight();
this->origin_province = prov;
+ this->origin_province->highlight();
this->province_selection_changed = true;
}
@@ -82,4 +84,5 @@
this->reinforcements -= 1;
orxout()<<"Province "<target_province->getID()<<" owned by Player "<target_province->getOwner_ID()<<" troops: "<target_province->getTroops()<playerFinishedStageCallback(this);
}
}
@@ -351,3 +354,12 @@
return this->is_active;
}
+
+ //Resets the two province pointers and dehighlights them.
+ void WagnisPlayer::resetProvinceSelection(){
+
+ if(this->origin_province != nullptr)this->origin_province->dehighlight();
+ if(this->target_province != nullptr)this->target_province->dehighlight();
+ this->origin_province = nullptr;
+ this->target_province = nullptr;
+ }
}
Index: /code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h
===================================================================
--- /code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h (revision 12159)
+++ /code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h (revision 12160)
@@ -38,4 +38,5 @@
void setActive(bool);
bool isActive() const;
+ void resetProvinceSelection();
Index: /code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc
===================================================================
--- /code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc (revision 12159)
+++ /code/branches/wagnis_HS18/src/modules/wagnis/WagnisProvince.cc (revision 12160)
@@ -20,5 +20,5 @@
this->owner_ID = -1;
this->troops = 0;
- this->setRadarName(std::to_string(0));
+ this->setRadarName("");
this->setRadarObjectColour(colour({128,128,128}, 100.0f));
this->ID = -1;
@@ -81,4 +81,8 @@
this->setOwner_ID( this->getOwner_ID() );
}
+
+
+
+
//set troops
void WagnisProvince::setTroops(int troops){