[prev in list] [next in list] [prev in thread] [next in thread] 

List:       atlantik-devel
Subject:    [atlantik-cvs]
From:       kde () office ! kde ! org
Date:       2003-06-17 18:21:30
[Download RAW message or body]

Update of /home/kde/kdegames/atlantik/libatlantic
In directory office:/tmp/cvs-serv15471/libatlantic

Modified Files:
	atlantic_core.cpp atlantic_core.h 
Log Message:
removed buggy trademap in network code for decent ptrlist in core

Index: atlantic_core.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantic/atlantic_core.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- atlantic_core.cpp	9 Jun 2003 18:22:35 -0000	1.20
+++ atlantic_core.cpp	17 Jun 2003 18:21:28 -0000	1.21
@@ -41,9 +41,10 @@
 	m_estateGroups.setAutoDelete(true);
 	m_estateGroups.clear();
 	m_estateGroups.setAutoDelete(false);
-	m_trades.setAutoDelete(true);
-	m_trades.clear();
-	m_trades.setAutoDelete(false);
+
+	Trade *trade = 0;
+	for (QPtrListIterator<Trade> it(m_trades); (trade = *it) ; ++it)
+		removeTrade(trade);
 
 	Player *player = 0;
 	for (QPtrListIterator<Player> it(m_players); (player = *it) ; ++it)
@@ -157,6 +158,16 @@
 	Trade *trade = new Trade(tradeId);
 	m_trades.append(trade);
 	return trade;
+}
+
+Trade *AtlanticCore::findTrade(int tradeId)
+{
+	Trade *trade = 0;
+	for (QPtrListIterator<Trade> it(m_trades); (trade = *it) ; ++it)
+		if (trade->tradeId() == tradeId)
+			return trade;
+
+	return 0;
 }
 
 void AtlanticCore::removeTrade(Trade *trade)

Index: atlantic_core.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantic/atlantic_core.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- atlantic_core.h	9 Jun 2003 18:22:36 -0000	1.18
+++ atlantic_core.h	17 Jun 2003 18:21:28 -0000	1.19
@@ -51,6 +51,7 @@
 
 	QPtrList<Trade> trades();
 	Trade *newTrade(int tradeId);
+	Trade *findTrade(int tradeId);
 	void removeTrade(Trade *trade);
 
 	QPtrList<Auction> auctions();

_______________________________________________
atlantik-cvs mailing list
atlantik-cvs@mail.kde.org
http://mail.kde.org/mailman/listinfo/atlantik-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic