[atlantik-cvs] CVS: kdegames/atlantik/libatlantic atlantic_core.cpp,1.16,1.17 atlantic_core.h,1.15,1.16

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

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

Index: atlantic_core.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantic/atlantic_core.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- atlantic_core.cpp	28 Nov 2002 21:38:24 -0000	1.16
+++ atlantic_core.cpp	19 Jan 2003 23:58:59 -0000	1.17
@@ -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 *)));
 }
 
@@ -66,6 +67,19 @@
 			return player;
 
 	return 0;
+}
+
+void AtlanticCore::removePlayer(Player *player)
+{
+	m_players.remove(player);
+	emit removeGUI(player);
+	emit deletePlayer(player);
+	delete 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.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- atlantic_core.h	28 Nov 2002 21:38:24 -0000	1.15
+++ atlantic_core.h	19 Jan 2003 23:58:59 -0000	1.16
@@ -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);
@@ -57,10 +58,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.