[atlantik-cvs] CVS: kdegames/atlantik/client atlantik.cpp,1.153,1.154 atlantik.h,1.59,1.60

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

Modified Files:
	atlantik.cpp atlantik.h 
Log Message:
move playerSelf to core, fixes some token issues

Index: atlantik.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.cpp,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -d -r1.153 -r1.154
--- atlantik.cpp	13 Jul 2003 04:41:40 -0000	1.153
+++ atlantik.cpp	14 Jul 2003 01:29:50 -0000	1.154
@@ -65,7 +65,6 @@
 	m_selectServer = 0;
 	m_selectGame = 0;
 	m_selectConfiguration = 0;
-	m_playerSelf = 0;
 	m_atlantikNetwork = 0;
 
 	// Game and network core
@@ -184,7 +183,7 @@
 	playerChanged(player);
 
 	if (player->isSelf())
-		m_playerSelf = player;
+		m_atlanticCore->setPlayerSelf(player);
 
 	connect(player, SIGNAL(changed(Player *)), this, SLOT(playerChanged(Player *)));
 	connect(player, SIGNAL(changed(Player *)), m_board, SLOT(playerChanged(Player *)));
@@ -243,7 +242,6 @@
 	}
 
 	m_atlanticCore->reset(true);
-	m_playerSelf = 0;
 
 	initNetworkObject();
 
@@ -307,8 +305,9 @@
 	if (m_selectConfiguration)
 		return;
 
+	Player *playerSelf = m_atlanticCore->playerSelf();
 	m_selectConfiguration = new SelectConfiguration(m_mainWidget, "selectConfiguration");
-	m_selectConfiguration->setCanStart(m_playerSelf ? m_playerSelf->master() : false);
+	m_selectConfiguration->setCanStart(playerSelf ? playerSelf->master() : false);
 	m_mainLayout->addMultiCellWidget(m_selectConfiguration, 0, 2, 1, 1);
 	m_selectConfiguration->show();
 
@@ -553,7 +552,8 @@
 	if (!portfolioView)
 		portfolioView = addPortfolioView(player);
 
-	if (player == m_playerSelf)
+	Player *playerSelf = m_atlanticCore->playerSelf();
+	if (player == playerSelf)
 	{
 		// We changed ourselves, see if other players (that we know
 		// about) have the same gameId..
@@ -563,7 +563,7 @@
 			if ((portfolioView = dynamic_cast<PortfolioView*>(*it)))
 			{
 				Player *pTmp = portfolioView->player();
-				if (pTmp->gameId() == m_playerSelf->gameId())
+				if (pTmp->gameId() == playerSelf->gameId())
 					portfolioView->show();
 				else
 					portfolioView->hide();
@@ -586,9 +586,9 @@
 	{
 		// Another player changed, check if we need to show or hide
 		// his/her portfolioView.
-		if (m_playerSelf)
+		if (playerSelf)
 		{
-			if (player->gameId() == m_playerSelf->gameId())
+			if (player->gameId() == playerSelf->gameId())
 				portfolioView->show();
 			else
 				portfolioView->hide();

Index: atlantik.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/client/atlantik.h,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- atlantik.h	13 Jul 2003 04:41:40 -0000	1.59
+++ atlantik.h	14 Jul 2003 01:29:50 -0000	1.60
@@ -212,8 +212,6 @@
 	AtlantikNetwork *m_atlantikNetwork;
 	AtlantikConfig m_config;
 
-	Player *m_playerSelf;
-
 	ConfigDialog *m_configDialog;
 	AtlantikBoard *m_board;
 	SelectServer *m_selectServer;
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.