1 /***************************************************************************
2 bcdoc.cpp - description
4 begin : Sun May 27 22:13:58 CEST 2001
5 copyright : (C) 2001 by Michael Andreen
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
42 bool BSDoc::saveAs(const QString &filename)
44 QString test = filename;
48 bool BSDoc::load(const QString &filename)
50 QString test = filename;
51 emit documentChanged();
55 bool BSDoc::isModified() const
60 ///////////////////////////////////////////////////////////////////////////
63 int BSDoc::newBattle(QString name)
65 m_Battles[name]["Friendly"]["Home Planet"] = new Planet();;
66 m_Battles[name]["Friendly"]["Home Fleet"] = new Fleet();
67 m_Battles[name]["Hostile"];
69 //Planet* pl = dynamic_cast<Planet*>(m_Battles[name]["Friendly"]["Home Planet"]);
71 emit documentChanged();
75 /////////////////////////////////////////////////////////////////////////
78 const BattleList& BSDoc::battles() const
83 //////////////////////////////////////////////////////////////////////////
85 const Fleet* BSDoc::specificFleet(QString battle, QString group, QString fleet) const
87 for (BattleList::const_iterator i = m_Battles.begin(); i != m_Battles.end(); ++i)
89 if (i->first == battle)
91 for (map<QString, map<QString, Fleet*> >::const_iterator j = i->second.begin(); j != i->second.end(); j++)
93 if (j->first == group)
95 for (map<QString, Fleet*>::const_iterator k = j->second.begin(); k != j->second.end(); ++k)
97 if (k->first == fleet)