File indexing completed on 2024-10-06 06:48:48

0001 /***************************************************************************
0002                           nationality.cpp  -  description
0003                              -------------------
0004     begin                : sam ao 31 2002
0005     copyright            : (C) 2002 by Gael de Chalendar
0006     email                : Gael.de.Chalendar@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 #include "nationality.h"
0024 
0025 #include <iostream>
0026 
0027 namespace Ksirk
0028 {
0029 
0030 namespace GameLogic
0031 {
0032 
0033 Nationality::Nationality(const QString &myName, const QString &myFlag, 
0034     const QString& leaderName) :
0035   m_name(myName), m_leaderName(leaderName), m_flagFileName(myFlag)
0036 {
0037 }
0038 
0039 
0040 /** Read property of QString flagFileName. */
0041 const QString& Nationality::flagFileName() const
0042 {
0043     return m_flagFileName;
0044 }
0045 
0046 void Nationality::saveXml(QTextStream& xmlStream)
0047 {
0048   QString name = m_name;
0049   name = name.replace("&","&amp;");
0050   name = name.replace("<","&lt;");
0051   name = name.replace(">","&gt;");
0052   xmlStream << "<nationality name=\"" << m_name << "\" flag=\"" << m_flagFileName << "\" />";  
0053 }
0054 
0055 const QString& Nationality::name() const
0056 {
0057   return m_name;
0058 }
0059 
0060 const QString& Nationality::leaderName() const
0061 {
0062   return m_leaderName;
0063 }
0064 
0065 } // closing namespace GameLogic
0066 } // closing namespace Ksirk