Index: code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc
===================================================================
--- code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc	(revision 12126)
+++ code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.cc	(revision 12127)
@@ -30,5 +30,6 @@
         SUPER(WagnisPlayer, tick, dt);
 
-        if(this->is_active){
+        if(this->is_active)
+        {
             for(WagnisProvince* prov:this->gameBoard->provs){
                 if(prov->getHealth() < prov->getMaxHealth()){
@@ -43,5 +44,6 @@
             }
 
-            if(this->province_selection_changed && this->origin_province != nullptr && this->target_province != nullptr){
+            if((this->province_selection_changed && this->origin_province != nullptr && this->target_province != nullptr)
+            ||(this->province_selection_changed && this->target_province != nullptr && ((gamestage == CHOOSE_PROVINCE_STAGE)||(gamestage == REINFORCEMENT_STAGE)))){
                 
                 this->province_selection_changed = false;
@@ -49,14 +51,58 @@
                     case CHOOSE_PROVINCE_STAGE: 
                     {   
-                        break;
-                    }
+                        if (checkMove(SET_TROOPS_INITIAL))
+                            this->target_province->owner_ID = this->Player_ID;
+                        
+                        break;
+                    }
+                    
                     case REINFORCEMENT_STAGE:
                     {
+                        if (checkMove(SET_TROOPS))
+                            this->target_province->troops += 1;
+                        
                         break;
                     }
                     case ATTACK_STAGE:{
+
+                        if (checkMove(ATTACK))
+                        {
+                            while ((this->origin_province->troops > 1) && (this->target_province->troops > 0)) //still troops available
+                            {
+                                while ((this->origin_province->troops >= 4) && (this->target_province->troops >= 2))
+                                {
+                                    //normal fight, 3 attackers, 2 defenders
+                                }
+
+                                if ((this->origin_province->troops == 3) && (this->target_province->troops >= 2))
+                                {
+                                    //2 attackers, 2 defenders
+                                }
+
+                                if((this->origin_province->troops == 2) && (this->target_province->troops >= 2))
+                                {
+                                    //1 attacker, 2 defenders
+                                }
+
+                                //TODO: implement other cases
+                            }
+
+                            if (this->target_province->troops == 0) //attacker won
+                            {
+                                this->target_province->owner_ID = this->Player_ID;
+                                this->target_province->troops = (this->origin_province->troops - 1);
+                                this->origin_province->troops = 1;
+                            }
+                        }
+                        
                         break;
                     }
                     case MOVE_STAGE:{
+
+                        if (checkMove(MOVE))
+                        {
+                            this->target_province->troops += ((this->origin_province->troops) - 1);
+                            this->origin_province->troops = 1;
+                        }
                         break;
                     }
@@ -73,9 +119,9 @@
     }
     //checks if a move is valid, possible MoveTypes: ATTACK, MOVE, SET_TROOPS, SET_TROOPS_INITIAL
-    bool WagnisPlayer::checkMove(WagnisProvince*,WagnisProvince*,MoveType move_type)
+    bool WagnisPlayer::checkMove(MoveType move_type)
     {
         if (move_type == ATTACK)
         {
-            if (isNeighbour(this->origin_province, this->target_province))//TODO: provinces neighbours
+            if (isNeighbour(this->origin_province, this->target_province))//provinces neighbours
             {
                 if (this->origin_province->getOwner_ID() == this->Player_ID) //origin belongs to player
@@ -89,5 +135,5 @@
         if (move_type == MOVE)
         {
-            if (existPath(this->origin_province, this->target_province))//TODO: path exists, all belong to same player
+            if (existPath(this->origin_province, this->target_province))//path exists, all belong to same player
             {
                 if (this->origin_province->getOwner_ID() == this->Player_ID)//origin belongs to player
@@ -105,5 +151,5 @@
         if (move_type == SET_TROOPS_INITIAL)
         {
-            if (this->target_province->getOwner_ID() == 0)//target belongs to nobody
+            if (this->target_province->getOwner_ID() == -1)//target belongs to nobody
                 return true;
         }
@@ -131,9 +177,9 @@
     //private function for CheckMove
     //checks if provinces are neighbours for move
-    bool WagnisPlayer::isNeighbour(WagnisProvince*,WagnisProvince*)
+    bool WagnisPlayer::isNeighbour(WagnisProvince* origin, WagnisProvince* target)
     {
-        for (unsigned int i = 0; i < this->origin_province->neighbors.size(); ++i)
-        {
-            if (this->target_province == this->origin_province->neighbors[i])
+        for (unsigned int i = 0; i < origin->neighbors.size(); ++i)
+        {
+            if (target == origin->neighbors[i])
                 return true;
         }
@@ -144,13 +190,13 @@
     //private function for CheckMove
     //checks if path is complete with provinces owned by player
-    bool WagnisPlayer::existPath(WagnisProvince*,WagnisProvince*)
+    bool WagnisPlayer::existPath(WagnisProvince* origin, WagnisProvince* target)
     {
-        if (this->origin_province->getOwner_ID() == this->target_province->getOwner_ID() && isNeighbour(this->origin_province, this->target_province))
+        if (origin->getOwner_ID() == target->getOwner_ID() && isNeighbour(origin, target))
             return true;
         
-        for (unsigned int i = 0; i < this->origin_province->neighbors.size(); ++i)
-        {
-            if (this->origin_province->getOwner_ID() == this->origin_province->neighbors[i]->getOwner_ID())
-                return existPath(this->origin_province->neighbors[i], this->target_province);
+        for (unsigned int i = 0; i < origin->neighbors.size(); ++i)
+        {
+            if (origin->getOwner_ID() == origin->neighbors[i]->getOwner_ID())
+                return existPath(origin->neighbors[i], target);
         }
             
Index: code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h
===================================================================
--- code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h	(revision 12126)
+++ code/branches/wagnis_HS18/src/modules/wagnis/WagnisPlayer.h	(revision 12127)
@@ -31,5 +31,5 @@
 
         void playerTurn();
-        bool checkMove(WagnisProvince*,WagnisProvince*,MoveType);
+        bool checkMove(MoveType);
         void setTroops(WagnisProvince*);
         void attack(WagnisProvince*,WagnisProvince*);
@@ -46,6 +46,6 @@
         WagnisProvince* origin_province;
         WagnisProvince* target_province;
-        bool isNeighbour(WagnisProvince*,WagnisProvince*);
-        bool existPath(WagnisProvince*,WagnisProvince*);
+        bool isNeighbour(WagnisProvince*, WagnisProvince*);
+        bool existPath(WagnisProvince*, WagnisProvince*);
     };
 }
