Index: code/branches/minigame4DHS14/src/modules/mini4Dgame/Mini4DgameCenterpoint.cc
===================================================================
--- code/branches/minigame4DHS14/src/modules/mini4Dgame/Mini4DgameCenterpoint.cc	(revision 10115)
+++ code/branches/minigame4DHS14/src/modules/mini4Dgame/Mini4DgameCenterpoint.cc	(revision 10121)
@@ -122,6 +122,6 @@
     	{
     		this->board[(int)move.x][(int)move.y][(int)move.z][(int)move.w] = playerColor;
-    		mini4DgamePlayerColor::color winner = this->getWinner();
-    		if(winner != mini4DgamePlayerColor::none)
+    		Mini4DgameWinner winner = this->getWinner();
+    		if(winner.color_ != mini4DgamePlayerColor::none)
     		{
     			Mini4Dgame->win(winner);
@@ -130,6 +130,9 @@
     }
 
-    mini4DgamePlayerColor::color Mini4DgameCenterpoint::getWinner()
+    Mini4DgameWinner Mini4DgameCenterpoint::getWinner()
     {
+    	Mini4DgameWinner winner;
+		winner.color_ = mini4DgamePlayerColor::none;
+
     	//check diagonals rows-columns-height-numbers
 		for(int i=1; i<4; i++)
@@ -138,5 +141,14 @@
 				break;
 			if(i==3)
-				return this->board[0][0][0][0];
+			{
+				winner.color_ = this->board[0][0][0][0];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = x;
+					winner.winningColumn[x] = x;
+					winner.winningHeight[x] = x;
+					winner.winningNumber[x] = x;
+				}
+				return winner;
+			}
 		}
 		for(int i=1; i<4; i++)
@@ -145,5 +157,14 @@
 				break;
 			if(i==3)
-				return this->board[3][0][0][0];
+			{
+				winner.color_ = this->board[3][0][0][0];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = 3-x;
+					winner.winningColumn[x] = x;
+					winner.winningHeight[x] = x;
+					winner.winningNumber[x] = x;
+				}
+				return winner;
+			}
 		}
 		for(int i=1; i<4; i++)
@@ -152,5 +173,14 @@
 				break;
 			if(i==3)
-				return this->board[0][3][0][0];
+			{
+				winner.color_ = this->board[0][3][0][0];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = x;
+					winner.winningColumn[x] = 3-x;
+					winner.winningHeight[x] = x;
+					winner.winningNumber[x] = x;
+				}
+				return winner;
+			}
 		}
 		for(int i=1; i<4; i++)
@@ -159,5 +189,14 @@
 				break;
 			if(i==3)
-				return this->board[0][0][3][0];
+			{
+				winner.color_ = this->board[0][0][3][0];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = x;
+					winner.winningColumn[x] = x;
+					winner.winningHeight[x] = 3-x;
+					winner.winningNumber[x] = x;
+				}
+				return winner;
+			}
 		}
 		for(int i=1; i<4; i++)
@@ -166,5 +205,14 @@
 				break;
 			if(i==3)
-				return this->board[0][0][0][3];
+			{
+				winner.color_ = this->board[0][0][0][3];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = x;
+					winner.winningColumn[x] = x;
+					winner.winningHeight[x] = x;
+					winner.winningNumber[x] = 3-x;
+				}
+				return winner;
+			}
 		}
 		for(int i=1; i<4; i++)
@@ -173,5 +221,14 @@
 				break;
 			if(i==3)
-				return this->board[3][3][0][0];
+			{
+				winner.color_ = this->board[3][3][0][0];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = 3-x;
+					winner.winningColumn[x] = 3-x;
+					winner.winningHeight[x] = x;
+					winner.winningNumber[x] = x;
+				}
+				return winner;
+			}
 		}
 		for(int i=1; i<4; i++)
@@ -180,5 +237,14 @@
 				break;
 			if(i==3)
-				return this->board[3][0][3][0];
+			{
+				winner.color_ = this->board[3][0][3][0];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = 3-x;
+					winner.winningColumn[x] = x;
+					winner.winningHeight[x] = 3-x;
+					winner.winningNumber[x] = x;
+				}
+				return winner;
+			}
 		}
 		for(int i=1; i<4; i++)
@@ -187,5 +253,14 @@
 				break;
 			if(i==3)
-				return this->board[3][0][0][3];
+			{
+				winner.color_ = this->board[3][0][0][3];
+				for(int x=0; x<4; x++){
+					winner.winningRow[x] = 3-x;
+					winner.winningColumn[x] = x;
+					winner.winningHeight[x] = x;
+					winner.winningNumber[x] = 3-x;
+				}
+				return winner;
+			}
 		}
 
@@ -198,5 +273,14 @@
 					break;
 				if(i==3)
-					return this->board[0][0][0][l];
+				{
+					winner.color_ = this->board[0][0][0][l];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = l;
+					}
+					return winner;
+				}
 			}
 			for(int i=1; i<4; i++)
@@ -205,5 +289,14 @@
 					break;
 				if(i==3)
-					return this->board[3][0][0][l];
+				{
+					winner.color_ = this->board[3][0][0][l];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = 3-x;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = l;
+					}
+					return winner;
+				}
 			}
 			for(int i=1; i<4; i++)
@@ -212,5 +305,14 @@
 					break;
 				if(i==3)
-					return this->board[0][3][0][l];
+				{
+					winner.color_ = this->board[0][3][0][l];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = 3-x;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = l;
+					}
+					return winner;
+				}
 			}
 			for(int i=1; i<4; i++)
@@ -219,5 +321,14 @@
 					break;
 				if(i==3)
-					return this->board[0][0][3][l];
+				{
+					winner.color_ = this->board[0][0][3][l];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = 3-x;
+						winner.winningNumber[x] = l;
+					}
+					return winner;
+				}
 			}
 		}
@@ -231,5 +342,14 @@
 					break;
 				if(i==3)
-					return this->board[0][0][l][0];
+				{
+					winner.color_ = this->board[0][0][l][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = l;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
 			}
 			for(int i=1; i<4; i++)
@@ -238,5 +358,14 @@
 					break;
 				if(i==3)
-					return this->board[3][0][l][0];
+				{
+					winner.color_ = this->board[3][0][l][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = 3-x;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = l;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
 			}
 			for(int i=1; i<4; i++)
@@ -245,5 +374,14 @@
 					break;
 				if(i==3)
-					return this->board[0][3][l][0];
+				{
+					winner.color_ = this->board[0][3][l][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = 3-x;
+						winner.winningHeight[x] = l;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
 			}
 			for(int i=1; i<4; i++)
@@ -252,5 +390,14 @@
 					break;
 				if(i==3)
-					return this->board[0][0][l][3];
+				{
+					winner.color_ = this->board[0][0][l][3];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = l;
+						winner.winningNumber[x] = 3-x;
+					}
+					return winner;
+				}
 			}
 		}
@@ -264,5 +411,14 @@
 					break;
 				if(i==3)
-					return this->board[0][l][0][0];
+				{
+					winner.color_ = this->board[0][l][0][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = l;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
 			}
 			for(int i=1; i<4; i++)
@@ -271,5 +427,14 @@
 					break;
 				if(i==3)
-					return this->board[3][l][0][0];
+				{
+					winner.color_ = this->board[3][l][0][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = 3-x;
+						winner.winningColumn[x] = l;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
 			}
 			for(int i=1; i<4; i++)
@@ -278,5 +443,14 @@
 					break;
 				if(i==3)
-					return this->board[0][l][3][0];
+				{
+					winner.color_ = this->board[0][l][3][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = l;
+						winner.winningHeight[x] = 3-x;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
 			}
 			for(int i=1; i<4; i++)
@@ -285,5 +459,14 @@
 					break;
 				if(i==3)
-					return this->board[0][l][0][3];
+				{
+					winner.color_ = this->board[0][l][0][3];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = x;
+						winner.winningColumn[x] = l;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = 3-x;
+					}
+					return winner;
+				}
 			}
 		}
@@ -297,5 +480,14 @@
 					break;
 				if(i==3)
-					return this->board[l][0][0][0];
+				{
+					winner.color_ = this->board[l][0][0][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = l;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
 			}
 			for(int i=1; i<4; i++)
@@ -304,5 +496,14 @@
 					break;
 				if(i==3)
-					return this->board[l][3][0][0];
+				{
+					winner.color_ = this->board[l][3][0][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = l;
+						winner.winningColumn[x] = 3-x;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
 			}
 			for(int i=1; i<4; i++)
@@ -311,5 +512,14 @@
 					break;
 				if(i==3)
-					return this->board[l][0][3][0];
+				{
+					winner.color_ = this->board[l][0][3][0];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = l;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = 3-x;
+						winner.winningNumber[x] = x;
+					}
+					return winner;
+				}
 			}
 			for(int i=1; i<4; i++)
@@ -318,19 +528,220 @@
 					break;
 				if(i==3)
-					return this->board[l][0][0][3];
-			}
-		}
-
-		//check diagonals rows-columns
+				{
+					winner.color_ = this->board[l][0][0][3];
+					for(int x=0; x<4; x++){
+						winner.winningRow[x] = l;
+						winner.winningColumn[x] = x;
+						winner.winningHeight[x] = x;
+						winner.winningNumber[x] = 3-x;
+					}
+					return winner;
+				}
+			}
+		}
+
+		//check 2d diagonals
 		for(int k=0;k<4;k++){
     		for(int l=0;l<4;l++){
+    			//rows-columns
     			for(int i=1; i<4; i++)
 				{
-					if(this->board[i][i][k][l]==mini4DgamePlayerColor::none || this->board[0][0][l][0] != this->board[i][i][l][i])
+					if(this->board[i][i][k][l]==mini4DgamePlayerColor::none || this->board[0][0][k][l] != this->board[i][i][k][l])
 						break;
 					if(i==3)
-						return this->board[0][0][l][0];
-				}}}
-    	//-------------------------------------------------------------------------------------------------------
+					{
+						winner.color_ = this->board[0][0][k][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = x;
+							winner.winningColumn[x] = x;
+							winner.winningHeight[x] = k;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
+					}
+				}
+				for(int i=1; i<4; i++)
+				{
+					if(this->board[3-i][i][k][l]==mini4DgamePlayerColor::none || this->board[3][0][k][l] != this->board[3-i][i][k][l])
+						break;
+					if(i==3)
+					{
+						winner.color_ = this->board[3][0][k][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = 3-x;
+							winner.winningColumn[x] = x;
+							winner.winningHeight[x] = k;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
+					}
+				}
+				//rows-height
+    			for(int i=1; i<4; i++)
+    			{
+    				if(this->board[i][k][i][l]==mini4DgamePlayerColor::none || this->board[0][k][0][l] != this->board[i][k][i][l])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[0][k][0][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = x;
+							winner.winningColumn[x] = k;
+							winner.winningHeight[x] = x;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
+					}
+				}
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[3-i][k][i][l]==mini4DgamePlayerColor::none || this->board[3][k][0][l] != this->board[3-i][k][i][l])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[3][k][0][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = 3-x;
+							winner.winningColumn[x] = k;
+							winner.winningHeight[x] = x;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
+					}
+				}
+				//rows-numbers
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[i][k][l][i]==mini4DgamePlayerColor::none || this->board[0][k][l][0] != this->board[i][k][l][i])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[0][k][l][0];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = x;
+							winner.winningColumn[x] = k;
+							winner.winningHeight[x] = l;
+							winner.winningNumber[x] = x;
+						}
+						return winner;
+					}
+				}
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[3-i][k][l][i]==mini4DgamePlayerColor::none || this->board[3][k][l][0] != this->board[3-i][k][l][i])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[3][k][l][0];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = 3-x;
+							winner.winningColumn[x] = k;
+							winner.winningHeight[x] = l;
+							winner.winningNumber[x] = x;
+						}
+						return winner;
+					}
+				}
+				//column-height
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[k][i][i][l]==mini4DgamePlayerColor::none || this->board[k][0][0][l] != this->board[k][i][i][l])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[k][0][0][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = k;
+							winner.winningColumn[x] = x;
+							winner.winningHeight[x] = x;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
+					}
+				}
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[k][3-i][i][l]==mini4DgamePlayerColor::none || this->board[k][3][0][l] != this->board[k][3-i][i][l])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[k][3][0][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = k;
+							winner.winningColumn[x] = 3-x;
+							winner.winningHeight[x] = x;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
+					}
+				}
+				//column-numbers
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[k][i][l][i]==mini4DgamePlayerColor::none || this->board[k][0][l][0] != this->board[k][i][l][i])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[k][0][l][0];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = k;
+							winner.winningColumn[x] = x;
+							winner.winningHeight[x] = l;
+							winner.winningNumber[x] = x;
+						}
+						return winner;
+					}
+				}
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[k][3-i][l][i]==mini4DgamePlayerColor::none || this->board[k][3][l][0] != this->board[k][3-i][l][i])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[k][3][l][0];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = k;
+							winner.winningColumn[x] = 3-x;
+							winner.winningHeight[x] = l;
+							winner.winningNumber[x] = x;
+						}
+						return winner;
+					}
+				}
+				//height-numbers
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[k][l][i][i]==mini4DgamePlayerColor::none || this->board[k][l][0][0] != this->board[k][l][i][i])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[k][l][0][0];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = k;
+							winner.winningColumn[x] = l;
+							winner.winningHeight[x] = x;
+							winner.winningNumber[x] = x;
+						}
+						return winner;
+					}
+				}
+				for(int i=1; i<4; i++)
+    			{
+    				if(this->board[k][l][3-i][i]==mini4DgamePlayerColor::none || this->board[k][l][3][0] != this->board[k][l][3-i][i])
+    					break;
+    				if(i==3)
+    				{
+						winner.color_ = this->board[k][l][3][0];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = k;
+							winner.winningColumn[x] = l;
+							winner.winningHeight[x] = 3-x;
+							winner.winningNumber[x] = x;
+						}
+						return winner;
+					}
+				}
+    		}
+    	}
 
     	//check rows
@@ -343,5 +754,12 @@
     				   && this->board[2][j][k][l]==this->board[3][j][k][l])
     				{
-    					return this->board[0][j][k][l];
+    					winner.color_ = this->board[0][j][k][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = x;
+							winner.winningColumn[x] = j;
+							winner.winningHeight[x] = k;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
     				}
     			}
@@ -358,5 +776,12 @@
     	    				   && this->board[i][2][k][l]==this->board[i][3][k][l])
     				{
-    	    			return this->board[i][0][k][l];
+    	    			winner.color_ = this->board[i][0][k][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = i;
+							winner.winningColumn[x] = x;
+							winner.winningHeight[x] = k;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
     				}
     			}
@@ -373,5 +798,12 @@
     	    	    				   && this->board[i][j][2][l]==this->board[i][j][3][l])
     				{
-    					return this->board[i][j][0][l];
+    					winner.color_ = this->board[i][j][0][l];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = i;
+							winner.winningColumn[x] = j;
+							winner.winningHeight[x] = x;
+							winner.winningNumber[x] = l;
+						}
+						return winner;
     				}
     			}
@@ -388,12 +820,17 @@
     	    	    				   && this->board[i][j][k][2]==this->board[i][j][k][3])
     				{
-    					return this->board[i][j][k][0];
+    					winner.color_ = this->board[i][j][k][0];
+						for(int x=0; x<4; x++){
+							winner.winningRow[x] = i;
+							winner.winningColumn[x] = j;
+							winner.winningHeight[x] = k;
+							winner.winningNumber[x] = x;
+						}
+						return winner;
     				}
     			}
     		}
     	}
-
-
-    	return mini4DgamePlayerColor::none;
+    	return winner;
     }
 }
