From c70919d0d5650bf98ea752e7e5f5364b4c3545e6 Mon Sep 17 00:00:00 2001
From: Francesco Bariatti <francesco.bariatti@insa-rennes.fr>
Date: Mon, 7 Mar 2016 10:52:23 +0100
Subject: [PATCH] Added toString

---
 src/game/penguin.cpp | 39 ++++++++++++++++++++-------------------
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/src/game/penguin.cpp b/src/game/penguin.cpp
index 421dce6..e6f3e30 100644
--- a/src/game/penguin.cpp
+++ b/src/game/penguin.cpp
@@ -366,8 +366,7 @@ namespace game
 	
 	string penguin::move_to_string(uint16_t m) const
 	{
-		//return std::to_string((state.possible_moves >> (4 * m)) & 0xf);
-		return "TODO";
+		return std::to_string(m);
 	}
 
 	set<int> penguin::to_input_vector() const
@@ -381,24 +380,26 @@ namespace game
 
 	string penguin::to_string() const
 	{
-		/*string result = "-------\n";
-		for (int row = 2; row >= 0; row--)
-		{
-			result += "|";
-			for (int col = 2; col >= 0; col--)
-			{
-				if(((state.cross_bitboard >> (3*row)) >> col) & 1)
-					result += player_to_string(CROSS)+"|";
-				else if (((state.circle_bitboard >> (3*row)) >> col) & 1)
-					result += player_to_string(CIRCLE)+"|";
-				else
-					result += std::to_string(row * 3 + col) + "|";
-			}
-			result += "\n-------\n";
-		}
+		string result= "--------------------";
+		result += "\n1 fish bro: " + std::to_string(state.one_fish);
+		result += "\nTwo fishes: " + std::to_string(state.two_fish);
+		result += "\nThree fish: " + std::to_string(state.three_fish);
+		result += "\nRed p1: " + std::to_string(state.p1_red);
+		result += "\nRed p2: " + std::to_string(state.p2_red);
+		result += "\nRed p3: " + std::to_string(state.p3_red);
+		result += "\nRed p4: " + std::to_string(state.p4_red);
+		result += "\nBlue p1: " + std::to_string(state.p1_blue);
+		result += "\nBlue p2: " + std::to_string(state.p2_blue);
+		result += "\nBlue p3: " + std::to_string(state.p3_blue);
+		result += "\nBlue p4: " + std::to_string(state.p4_blue);
+		
+		result += "\nScore R: " + std::to_string(state.score_red);
+		result += "\nScore B: " + std::to_string(state.score_blue);
+		
+		result += "\nNb possible moves R:" + std::to_string(state.nb_moves_red);
+		result += "\nNb possible moves B:" + std::to_string(state.nb_moves_blue);
+		
 		return result;
-		*/
-		return "TODO";
 	}
 
 	std::uint64_t penguin::hash() const
-- 
GitLab