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

List:       kde-commits
Subject:    branches/work/kde4/playground/games/crossedwords/src
From:       Albert Astals Cid <tsdgeos () terra ! es>
Date:       2005-09-30 21:36:23
Message-ID: 1128116183.569015.27130.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 465807 by aacid:

make the clients recognise how's going to play next


 M  +1 -1      chatwidget.cpp  
 M  +10 -1     client.cpp  
 M  +2 -0      crossedwords.cpp  


--- branches/work/kde4/playground/games/crossedwords/src/chatwidget.cpp \
#465806:465807 @@ -66,7 +66,7 @@
 
 void chatWidget::nextPlayer(const QString &nick, bool isItMe)
 {
-	if (isItMe) i18n("<font color=\"blue\">* It is your turn</font>");
+	if (isItMe) textEdit->append(i18n("<font color=\"blue\">* It is your \
turn</font>"));  else textEdit->append(i18n("<font color=\"blue\">* It is the turn of \
%1</font>").arg(nick));  }
 
--- branches/work/kde4/playground/games/crossedwords/src/client.cpp #465806:465807
@@ -99,13 +99,22 @@
 			if (i == STARTING_GAME)
 			{
 				emit startGame();
-				for (int i = 0; i < 7; i++)
+				for (int j = 0; j < 7; j++)
 				{
 					tile *t = new tile();
 					m_stream >> *t;
 					emit newTile(t);
 				}
 				m_phase = PLAYING_GAME;
+				
+				aux = m_stream.readLine();
+				i = aux.toInt();
+				if (i == NEXT_TURN)
+				{
+					QString nick = m_stream.readLine();
+					emit nextPlayer(nick, nick == m_nick);
+				}
+				else wrongResponse();
 			}
 			else if (i == MESSAGE)
 			{
--- branches/work/kde4/playground/games/crossedwords/src/crossedwords.cpp \
#465806:465807 @@ -173,6 +173,8 @@
 	connect(m_client, SIGNAL(startGame()), m_chatWidget, SLOT(startGame()));
 	connect(m_client, SIGNAL(startGame()), this, SLOT(startGame()));
 	connect(m_client, SIGNAL(newTile(tile *)), m_tileWidget, SLOT(addTile(tile *)));
+	connect(m_client, SIGNAL(nextPlayer(const QString &, bool)), m_chatWidget, \
SLOT(nextPlayer(const QString &, bool))); +	connect(m_client, SIGNAL(nextPlayer(const \
QString &, bool)), m_board, SLOT(nextPlayer(const QString &, bool)));  \
m_client->tryConnect();  }
 


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

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