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

List:       atlantik-devel
Subject:    [atlantik-cvs] CVS: kdegames/atlantik/libatlantic Makefile.am,
From:       kde () office ! kde ! org
Date:       2003-12-07 22:37:34
[Download RAW message or body]

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

Modified Files:
      Tag: atlantik_3_3_branch
	Makefile.am atlantic_core.cpp atlantic_core.h 
Log Message:
network/core support for new configupdate behavior

Index: Makefile.am
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantic/Makefile.am,v
retrieving revision 1.11.2.1
retrieving revision 1.11.2.2
diff -u -d -r1.11.2.1 -r1.11.2.2
--- Makefile.am	15 Nov 2003 22:09:06 -0000	1.11.2.1
+++ Makefile.am	7 Dec 2003 22:37:29 -0000	1.11.2.2
@@ -5,11 +5,11 @@
 libatlantic_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -no-undefined -version-info \
3:0:2  libatlantic_la_LIBADD = $(LIB_QT)
 
-libatlantic_la_SOURCES = atlantic_core.cpp auction.cpp estate.cpp \
+libatlantic_la_SOURCES = atlantic_core.cpp auction.cpp configoption.cpp estate.cpp \
 	estategroup.cpp game.cpp player.cpp trade.cpp
 
 libatlanticincludedir = $(includedir)/atlantic
-libatlanticinclude_HEADERS = atlantic_core.h auction.h estate.h \
+libatlanticinclude_HEADERS = atlantic_core.h auction.h configoption.h estate.h \
 	estategroup.h game.h player.h trade.h
 
 METASOURCES = AUTO

Index: atlantic_core.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantic/atlantic_core.cpp,v
retrieving revision 1.27.2.2
retrieving revision 1.27.2.3
diff -u -d -r1.27.2.2 -r1.27.2.3
--- atlantic_core.cpp	17 Nov 2003 02:50:42 -0000	1.27.2.2
+++ atlantic_core.cpp	7 Dec 2003 22:37:29 -0000	1.27.2.3
@@ -19,6 +19,7 @@
 #include "atlantic_core.h"
 
 #include "auction.h"
+#include "configoption.h"
 #include "estate.h"
 #include "estategroup.h"
 #include "game.h"
@@ -41,6 +42,9 @@
 	m_estateGroups.setAutoDelete(true);
 	m_estateGroups.clear();
 	m_estateGroups.setAutoDelete(false);
+	m_configOptions.setAutoDelete(true);
+	m_configOptions.clear();
+	m_configOptions.setAutoDelete(false);
 
 	Trade *trade = 0;
 	for (QPtrListIterator<Trade> it(m_trades); (trade = *it) ; ++it)
@@ -301,6 +305,33 @@
 	delete auction;
 }
 
+ConfigOption *AtlanticCore::newConfigOption(int configId)
+{
+	ConfigOption *configOption = new ConfigOption(configId);
+	m_configOptions.append(configOption);
+
+	emit createGUI(configOption);
+
+	return configOption;
+}
+
+void AtlanticCore::removeConfigOption(ConfigOption *configOption)
+{
+	m_configOptions.remove(configOption);
+	emit removeGUI(configOption);
+	configOption->deleteLater();
+}
+
+ConfigOption *AtlanticCore::findConfigOption(int configId)
+{
+	ConfigOption *configOption = 0;
+	for (QPtrListIterator<ConfigOption> it(m_configOptions); (configOption = *it) ; \
++it) +		if (configOption->id() == configId)
+			return configOption;
+
+	return 0;
+}
+
 void AtlanticCore::printDebug()
 {
 	Player *player = 0;
@@ -324,11 +355,15 @@
 
 	Auction *auction = 0;
 	for (QPtrListIterator<Auction> it(m_auctions); (auction = *it) ; ++it)
-		std::cout << "A: " << QString::number(auction->auctionId()).latin1() << std::endl;
+		std::cout << " A: " << QString::number(auction->auctionId()).latin1() << \
std::endl;  
 	Trade *trade = 0;
 	for (QPtrListIterator<Trade> it(m_trades); (trade = *it) ; ++it)
-		std::cout << "T: " << QString::number(trade->tradeId()).latin1() << std::endl;
+		std::cout << " T: " << QString::number(trade->tradeId()).latin1() << std::endl;
+
+	ConfigOption *configOption = 0;
+	for (QPtrListIterator<ConfigOption> it(m_configOptions); (configOption = *it) ; \
++it) +		std::cout << "CO:" << QString::number(configOption->id()).latin1() << " " << \
configOption->name().latin1() << std::endl;  }
 
 #include "atlantic_core.moc"

Index: atlantic_core.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantic/atlantic_core.h,v
retrieving revision 1.22.2.2
retrieving revision 1.22.2.3
diff -u -d -r1.22.2.2 -r1.22.2.3
--- atlantic_core.h	17 Nov 2003 02:50:42 -0000	1.22.2.2
+++ atlantic_core.h	7 Dec 2003 22:37:29 -0000	1.22.2.3
@@ -21,6 +21,7 @@
 #include <qptrlist.h>
 
 class Player;
+class ConfigOption;
 class Estate;
 class EstateGroup;
 class Game;
@@ -72,6 +73,10 @@
 	Auction *newAuction(int auctionId, Estate *estate);
 	void delAuction(Auction *auction);
 
+	ConfigOption *newConfigOption(int configId);
+	void removeConfigOption(ConfigOption *configOption);
+	ConfigOption *findConfigOption(int configId);
+
 	void printDebug();
 
 signals:
@@ -81,6 +86,8 @@
 	void removeGUI(Game *game);
 	void createGUI(Trade *trade);
 	void removeGUI(Trade *trade);
+	void createGUI(ConfigOption *configOption);
+	void removeGUI(ConfigOption *configOption);
 
 private:
 	Player *m_playerSelf;
@@ -90,6 +97,7 @@
 	QPtrList<EstateGroup> m_estateGroups;
 	QPtrList<Trade> m_trades;
 	QPtrList<Auction> m_auctions;
+	QPtrList<ConfigOption> m_configOptions;
 };
 
 #endif

_______________________________________________
atlantik-cvs mailing list
atlantik-cvs@kde.org
https://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