[atlantik-cvs] CVS: kdegames/atlantik/libatlantic atlantic_core.cpp,1.14.4.2,1.14.4.3 atlantic_core.h,1.13.4.2,1.13.4.3

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

Modified Files:
      Tag: KDE_3_1_BRANCH
	atlantic_core.cpp atlantic_core.h 
Log Message:
backport correct implementation of removePlayer

Index: atlantic_core.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantic/atlantic_core.cpp,v
retrieving revision 1.14.4.2
retrieving revision 1.14.4.3
diff -u -d -r1.14.4.2 -r1.14.4.3
--- atlantic_core.cpp	13 Jan 2003 17:14:39 -0000	1.14.4.2
+++ atlantic_core.cpp	20 Jan 2003 22:37:59 -0000	1.14.4.3
@@ -24,6 +24,7 @@
 
 AtlanticCore::AtlanticCore(QObject *parent, const char *name) : QObject(parent, name)
 {
+	connect(this, SIGNAL(deletePlayer(Player *)), this, SLOT(slotDeletePlayer(Player *)));
 	connect(this, SIGNAL(deleteTrade(Trade *)), this, SLOT(slotDeleteTrade(Trade *)));
 }
 
@@ -68,6 +69,17 @@
 	return 0;
 }
 
+void AtlanticCore::removePlayer(Player *player)
+{
+	m_players.remove(player);
+	emit removeGUI(player);
+	emit deletePlayer(player);
+}
+
+void AtlanticCore::slotDeletePlayer(Player *player)
+{
+	delete player;
+}
 
 QPtrList<Estate> AtlanticCore::estates()
 {

Index: atlantic_core.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantic/atlantic_core.h,v
retrieving revision 1.13.4.2
retrieving revision 1.13.4.3
diff -u -d -r1.13.4.2 -r1.13.4.3
--- atlantic_core.h	13 Jan 2003 17:14:39 -0000	1.13.4.2
+++ atlantic_core.h	20 Jan 2003 22:37:59 -0000	1.13.4.3
@@ -38,6 +38,7 @@
 	QPtrList<Player> players();
 	Player *newPlayer(int playerId);
 	Player *findPlayer(int playerId);
+	void removePlayer(Player *player);
 
 	QPtrList<Estate> estates();
 	Estate *newEstate(int estateId);
@@ -56,10 +57,13 @@
 	void delAuction(Auction *auction);
 
 signals:
+	void removeGUI(Player *player);
+	void deletePlayer(Player *player);
 	void removeGUI(Trade *trade);
 	void deleteTrade(Trade *trade);
 
 private slots:
+	void slotDeletePlayer(Player *player);
 	void slotDeleteTrade(Trade *trade);
 
 private:
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.