[atlantik-cvs] CVS: kdegames/atlantik/client atlantik.cpp,1.134,1.135 atlantik.h,1.52,1.53

[email protected]
Newsgroups gmane.comp.kde.devel.atlantik
Message-ID <[email protected]>
Update of /home/kde/kdegames/atlantik/client
In directory office:/tmp/cvs-serv19116/client

Modified Files:
	atlantik.cpp atlantik.h 
Log Message:
keep track of gameid for players

Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -d -r1.134 -r1.135
--- atlantik.cpp	19 Jan 2003 21:06:16 -0000	1.134
+++ atlantik.cpp	19 Jan 2003 23:58:59 -0000	1.135
@@ -69,6 +69,7 @@
 	m_atlanticCore = new AtlanticCore(this, "atlanticCore");
 	initNetworkObject();
 
+	connect(m_atlanticCore, SIGNAL(removeGUI(Player *)), this, SLOT(removeGUI(Player *)));
 	connect(m_atlanticCore, SIGNAL(removeGUI(Trade *)), this, SLOT(removeGUI(Trade *)));
 
 	// Menu,toolbar: Move
@@ -177,10 +178,9 @@
 	m_portfolioViews.append(portfolioView);
 
 	if (player->isSelf())
-	{
 		m_playerSelf = player;
-		connect(player, SIGNAL(changed(Player *)), this, SLOT(playerChanged()));
-	}
+
+	connect(player, SIGNAL(changed(Player *)), this, SLOT(playerChanged(Player *)));
 	connect(player, SIGNAL(changed(Player *)), portfolioView, SLOT(playerChanged()));
 	connect(player, SIGNAL(changed(Player *)), m_board, SLOT(playerChanged(Player *)));
 	connect(portfolioView, SIGNAL(newTrade(Player *)), m_atlantikNetwork, SLOT(newTrade(Player *)));
@@ -209,6 +209,12 @@
 	m_board->addAuctionWidget(auction);
 }
 
+void Atlantik::removeGUI(Player *player)
+{
+	// Find and remove portfolioview
+	// TODO: Remove tokens from board
+}
+
 void Atlantik::removeGUI(Trade *trade)
 {
 	if (TradeDisplay *tradeDisplay = m_tradeGUIMap[trade])
@@ -499,17 +505,25 @@
 	m_serverMsgs->ensureVisible(0, m_serverMsgs->contentsHeight());
 }
 
-void Atlantik::playerChanged()
+void Atlantik::playerChanged(Player *player)
 {
-	m_roll->setEnabled(m_playerSelf->canRoll());
-	m_buyEstate->setEnabled(m_playerSelf->canBuy());
-	m_auctionEstate->setEnabled(m_playerSelf->canBuy());
+	if (player->gameId() == -1)
+	{
+		// Find and remove portfolioview
+	}
 
-	// TODO: Should be more finetuned, but monopd doesn't send can_endturn can_usejailcard can_payjail can_jailroll yet
-	m_endTurn->setEnabled(m_playerSelf->hasTurn() && !(m_playerSelf->canRoll() || m_playerSelf->canBuy() || m_playerSelf->inJail()));
-	m_jailCard->setEnabled(m_playerSelf->hasTurn() && m_playerSelf->inJail());
-	m_jailPay->setEnabled(m_playerSelf->hasTurn() && m_playerSelf->inJail());
-	m_jailRoll->setEnabled(m_playerSelf->hasTurn() && m_playerSelf->inJail());
+	if (player == m_playerSelf)
+	{
+		m_roll->setEnabled(player->canRoll());
+		m_buyEstate->setEnabled(player->canBuy());
+		m_auctionEstate->setEnabled(player->canBuy());
+
+		// TODO: Should be more finetuned, but monopd doesn't send can_endturn can_usejailcard can_payjail can_jailroll yet
+		m_endTurn->setEnabled(player->hasTurn() && !(player->canRoll() || player->canBuy() || player->inJail()));
+		m_jailCard->setEnabled(player->hasTurn() && player->inJail());
+		m_jailPay->setEnabled(player->hasTurn() && player->inJail());
+		m_jailRoll->setEnabled(player->hasTurn() && player->inJail());
+	}
 }
 
 void Atlantik::initNetworkObject()

Index: atlantik.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- atlantik.h	9 Jan 2003 01:35:43 -0000	1.52
+++ atlantik.h	19 Jan 2003 23:58:59 -0000	1.53
@@ -170,9 +170,10 @@
 	void newTrade(Trade *trade);
 	void newAuction(Auction *auction);
 
+	void removeGUI(Player *player);
 	void removeGUI(Trade *trade);
 
-	void playerChanged();
+	void playerChanged(Player *player);
 
 signals:
 	void rollDice();
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.