[Orxonox-commit 7542] r12145 - code/branches/wagnis_HS18/src/modules/wagnis
samuelbl at orxonox.net
samuelbl at orxonox.net
Wed Dec 5 10:54:17 CET 2018
Author: samuelbl
Date: 2018-12-05 10:54:17 +0100 (Wed, 05 Dec 2018)
New Revision: 12145
Modified:
code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc
code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h
Log:
Player fixed
Modified: code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc
===================================================================
--- code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc 2018-12-05 09:48:32 UTC (rev 12144)
+++ code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc 2018-12-05 09:54:17 UTC (rev 12145)
@@ -20,6 +20,7 @@
this->target_province = nullptr;
this->province_selection_changed = false;
this->gameStage = NOT_READY;
+ this->reinforcements = 0;
}
//Destructor
WagnisPlayer::~WagnisPlayer(){
@@ -67,7 +68,6 @@
}else{
orxout()<<"Sorry, someone already owns this provice"<<endl;
}
- //TODO: Set more troops to provinces before game begins
break;
}
@@ -219,12 +219,6 @@
}
}
-
-
- //Manages a Players turn
- void WagnisPlayer::playerTurn(){
-
- }
//checks if a move is valid, possible MoveTypes: ATTACK, MOVE, SET_TROOPS, SET_TROOPS_INITIAL
bool WagnisPlayer::checkMove(MoveType move_type)
{
@@ -264,17 +258,7 @@
return false;
}
-
- //
- void WagnisPlayer::setTroops(WagnisProvince*){
- }
- void WagnisPlayer::attack(WagnisProvince*,WagnisProvince*){
-
- }
- void WagnisPlayer::moveTroops(WagnisProvince*,WagnisProvince*){
-
- }
//Return a "Player x" String
std::string WagnisPlayer::toString(){
std::string str = "Player ";
@@ -317,7 +301,7 @@
return (rand()%6+1);
}
- int WagnisPlayer::best3(int a, int b, int c)
+ int WagnisPlayer::best3(int a, int b, int c) //returns best of 3 integers for attack stage
{
if(a >= b && a>= c)
return a;
@@ -327,7 +311,7 @@
return c;
}
- int WagnisPlayer::best2(int a, int b)
+ int WagnisPlayer::best2(int a, int b) //returns best of 2 integers for attack stage
{
if(a >= b)
return a;
@@ -335,7 +319,7 @@
return b;
}
- int WagnisPlayer::second3(int a, int b, int c)
+ int WagnisPlayer::second3(int a, int b, int c) //returns second of 3 integers for attack stage
{
if((a >= b && a <= c)||(a <= b && a >= c))
return a;
@@ -345,7 +329,7 @@
return c;
}
- int WagnisPlayer::second2(int a, int b)
+ int WagnisPlayer::second2(int a, int b) //returns second of 2 integers for attack stage
{
if(a <= b)
return a;
@@ -352,20 +336,4 @@
else
return b;
}
-
- int WagnisPlayer::reinforcementCounter() //calculates and sets reeinforcements how many troops a player gets at beginning of his turn
- {
-
- reinforcements = 10;
- orxout()<<"derp"<<endl;
- /*
- int counter = 0;
-
- for (int i = 0; i <= 100; ++i)
- {
- if
- }
- */
-
- }
}
Modified: code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h
===================================================================
--- code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h 2018-12-05 09:48:32 UTC (rev 12144)
+++ code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h 2018-12-05 09:54:17 UTC (rev 12145)
@@ -54,7 +54,6 @@
int best2(int, int);
int second3(int, int, int);
int second2(int, int);
- int reinforcementCounter();
};
}
More information about the Orxonox-commit
mailing list