QTfrontend/net/newnetclient.cpp
changeset 8416 e691acd778f5
parent 8401 87410ae372f6
child 8436 b89aacebb9db
--- a/QTfrontend/net/newnetclient.cpp	Mon Jan 21 00:30:18 2013 -0500
+++ b/QTfrontend/net/newnetclient.cpp	Mon Jan 21 02:21:04 2013 -0500
@@ -933,6 +933,15 @@
     RawSendNet(QString("CMD%1%2").arg(delimeter).arg(cmd));
 }
 
+bool HWNewNet::allPlayersReady()
+{
+    int ready = 0;
+    for (int i = 0; i < m_roomPlayersModel->rowCount(); i++)
+        if (m_roomPlayersModel->index(i, 0).data(PlayersListModel::Ready).toBool()) ready++;
+
+    return (ready == m_roomPlayersModel->rowCount());
+}
+
 void HWNewNet::startGame()
 {
     RawSendNet(QString("START_GAME"));
@@ -1016,4 +1025,4 @@
 QAbstractItemModel *HWNewNet::roomPlayersModel()
 {
     return m_roomPlayersModel;
-}
+}
\ No newline at end of file