[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/games/backgammon
From:       Dmitry Vladimirovich Chernov <diman4ik.chernov () gmail ! com>
Date:       2013-11-10 7:45:08
Message-ID: E1VfPhk-0001HG-4e () scm ! kde ! org
[Download RAW message or body]

SVN commit 1369300 by dmitryvchernov:

bugfix with fibs game

 M  +1 -0      games/backgammon/fibs/backgammon_fibs.cpp  
 M  +6 -2      games/backgammon/fibs/clip.cpp  
 M  +4 -2      test/test_clip.cpp  


--- trunk/playground/games/backgammon/games/backgammon/fibs/backgammon_fibs.cpp #1369299:1369300
@@ -1000,6 +1000,7 @@
 	Clip::parseBoardStyle3( line, field, dice, m_yourTurn, m_needReverse );
 	
 	setBoard( field );
+	emit( setCheckerPositions( BackgammonGame::getBoard() ) );
 	
 	Rolls your_roll( dice[0], dice[1] );
     Rolls opponent_roll( dice[2], dice[3] );
--- trunk/playground/games/backgammon/games/backgammon/fibs/clip.cpp #1369299:1369300
@@ -503,10 +503,14 @@
 	
     yourTurn = ( youPlayerX ) ? XsTurn : !XsTurn;
     
-    dice.push_back( parts[33].toInt() );
+    /*dice.push_back( parts[33].toInt() );
 	dice.push_back( parts[34].toInt() );
 	dice.push_back( parts[35].toInt() );
-	dice.push_back( parts[36].toInt() );
+	dice.push_back( parts[36].toInt() );*/
+	dice[0] = parts[33].toInt();
+	dice[1] = parts[34].toInt();
+	dice[2] = parts[35].toInt();
+	dice[3] = parts[36].toInt();
     
     int doubling_cube = parts[37].toInt();
     int may_double_you = parts[38].toInt();
--- trunk/playground/games/backgammon/test/test_clip.cpp #1369299:1369300
@@ -56,7 +56,7 @@
 	 */
 	
 	QVector<int> field(28);
-	QVector<int> dice(2);
+	QVector<int> dice(4);
 	bool yourturn = false;
 	bool needreverse = false;
 	
@@ -64,6 +64,8 @@
 	
 	QVERIFY( needreverse == false );
 	QVERIFY( yourturn == true );
+	QVERIFY( dice[0] == 4 );
+	QVERIFY( dice[1] == 1 );
 }
 
 void TestClip::testReadBoard2()
@@ -102,7 +104,7 @@
 	 */
 	
 	QVector<int> field(28);
-	QVector<int> dice(2);
+	QVector<int> dice(4);
 	bool yourturn = false;
 	bool needreverse = false;
 	
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic