File indexing completed on 2024-04-28 04:04:37
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 KSIRKSKINEDITORNATIONALITY_H 0024 #define KSIRKSKINEDITORNATIONALITY_H 0025 0026 #include <QString> 0027 #include <QTextStream> 0028 0029 namespace KsirkSkinEditor 0030 { 0031 0032 /** 0033 * The Nationality class stores all what represents a nation identity : name, 0034 * flag, etc. 0035 * Nations in KsirK are not bound to a country, they just represent a player 0036 * identity. 0037 * @author Gael de Chalendar (aka Kleag) 0038 */ 0039 class Nationality 0040 { 0041 public: 0042 /** 0043 * Constructor 0044 * @param myName The name of the nationality. 0045 * @param myFlag The file name of the flag. 0046 * @param leaderName The name of the nation's leader. Will be used as the 0047 * displayed player's name. 0048 */ 0049 Nationality(const QString &myName, const QString &myFlag, const QString& leaderName); 0050 0051 /** Default destructor */ 0052 virtual ~Nationality() {} 0053 0054 /** Read property of QString m_flagFileName. */ 0055 inline const QString& flagFileName() const {return m_flagFileName;} 0056 inline void setFlagFileName(const QString& f) 0057 {m_flagFileName = f;} 0058 0059 /** Read property of QString m_name. */ 0060 inline const QString& name() const {return m_name;} 0061 inline void setName(const QString& n) {m_name = n;} 0062 0063 /** Read property of QString m_leaderName. */ 0064 inline const QString& leaderName() const {return m_leaderName;} 0065 inline void setLeaderName(const QString& l) {m_leaderName = l;} 0066 0067 /** 0068 * Saves a XML representation of the nationality for game saving purpose 0069 * @param xmlStream The stream to write on 0070 */ 0071 void saveXml(QTextStream& xmlStream); 0072 0073 private: // Private attributes 0074 0075 /** The nation's name. The name of its associated country in the real world. */ 0076 QString m_name; 0077 0078 /** The default name given to a player of the nationality */ 0079 QString m_leaderName; 0080 0081 /** The name of the file containing this nation's flag */ 0082 QString m_flagFileName; 0083 }; 0084 0085 } 0086 0087 #endif // NATIONALITY_H