[atlantik-cvs] CVS: kdegames/atlantik/libatlantic player.cpp,1.15,1.16 player.h,1.12,1.13

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

Modified Files:
	player.cpp player.h 
Log Message:
keep track of gameId of players

Index: player.cpp
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantic/player.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- player.cpp	19 Dec 2002 23:27:27 -0000	1.15
+++ player.cpp	19 Jan 2003 23:57:26 -0000	1.16
@@ -1,4 +1,4 @@
-// Copyright (c) 2002 Rob Kaper <[email protected]>
+// Copyright (c) 2002-2003 Rob Kaper <[email protected]>
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -21,6 +21,7 @@
 Player::Player(int playerId) : QObject()
 {
 	m_id = playerId;
+	m_gameId = -1;
 	m_name = "";
 	m_host = "";
 	m_image = "";
@@ -28,6 +29,15 @@
 	m_money = 0;
 	m_changed = m_isSelf = false;
 	m_master = m_hasTurn = m_canRoll = m_canBuy = m_inJail = false;
+}
+
+void Player::setGame(int gameId)
+{
+	if (m_gameId != gameId)
+	{
+		m_gameId = gameId;
+		m_changed = true;
+	}
 }
 
 void Player::setLocation(Estate *location)

Index: player.h
===================================================================
RCS file: /home/kde/kdegames/atlantik/libatlantic/player.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- player.h	19 Dec 2002 23:27:27 -0000	1.12
+++ player.h	19 Jan 2003 23:57:26 -0000	1.13
@@ -1,4 +1,4 @@
-// Copyright (c) 2002 Rob Kaper <[email protected]>
+// Copyright (c) 2002-2003 Rob Kaper <[email protected]>
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -30,6 +30,8 @@
 	Player(int playerId);
 
 	int id() { return m_id; }
+	void setGame(int gameId);
+	int gameId() { return m_gameId; }
 	void setLocation(Estate *estate);
 	Estate *location() { return m_location; }
 	void setDestination(Estate *estate);
@@ -60,7 +62,7 @@
 	void changed(Player *player);
 
 private:
-	int m_id;
+	int m_id, m_gameId;
 	bool m_changed, m_isSelf;
 	bool m_master, m_hasTurn, m_canRoll, m_canBuy, m_inJail;
 	unsigned int m_money;
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.