File indexing completed on 2024-10-06 06:48:48
0001 /*************************************************************************** 0002 nationality.h - description 0003 ------------------- 0004 begin : sat aug 31 2002 0005 copyright : (C) 2002-2007 by Gael de Chalendar 0006 email : Kleag@free.fr 0007 ***************************************************************************/ 0008 0009 /*************************************************************************** 0010 * * 0011 * This program is free software; you can redistribute it and/or modify * 0012 * it under the terms of the GNU General Public License as published by * 0013 * the Free Software Foundation; either either version 2 0014 of the License, or (at your option) any later version.of the License, or * 0015 * (at your option) any later version. * 0016 * * 0017 * You should have received a copy of the GNU General Public License 0018 * along with this program; if not, write to the Free Software 0019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 0020 * 02110-1301, USA 0021 ***************************************************************************/ 0022 0023 #ifndef NATIONALITY_H 0024 #define NATIONALITY_H 0025 0026 #include <QString> 0027 #include <QTextStream> 0028 0029 namespace Ksirk 0030 { 0031 0032 namespace GameLogic 0033 { 0034 0035 /** 0036 * The Nationality class stores all what represents a nation identity : name, 0037 * flag, etc. 0038 * Nations in KsirK are not bound to a country, they just represent a player 0039 * identity. 0040 * @author Gael de Chalendar (aka Kleag) 0041 */ 0042 class Nationality 0043 { 0044 public: 0045 /** 0046 * Constructor 0047 * @param myName The name of the nationality. 0048 * @param myFlag The file name of the flag. 0049 * @param leaderName The name of the nation's leader. Will be used as the 0050 * displayed player's name. 0051 */ 0052 Nationality(const QString &myName, const QString &myFlag, const QString& leaderName); 0053 0054 /** Default destructor */ 0055 virtual ~Nationality() {} 0056 0057 /** Read property of QString m_flagFileName. */ 0058 virtual const QString& flagFileName() const; 0059 0060 /** Read property of QString m_name. */ 0061 const QString& name() const; 0062 0063 /** Read property of QString m_leaderName. */ 0064 const QString& leaderName() const; 0065 0066 /** 0067 * Saves a XML representation of the nationality for game saving purpose 0068 * @param xmlStream The stream to write on 0069 */ 0070 void saveXml(QTextStream& xmlStream); 0071 0072 private: // Private attributes 0073 0074 /** The nation's name. The name of its associated country in the real world. */ 0075 QString m_name; 0076 0077 /** The default name given to a player of the nationality */ 0078 QString m_leaderName; 0079 0080 /** The name of the file containing this nation's flag */ 0081 const QString m_flagFileName; 0082 }; 0083 0084 } 0085 } 0086 0087 #endif // NATIONALITY_H