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 ***************************************************************************/
40 bool BSDoc::saveAs(const QString &filename)
45 bool BSDoc::load(const QString &filename)
47 emit documentChanged();
51 bool BSDoc::isModified() const
56 ///////////////////////////////////////////////////////////////////////////
59 int BSDoc::newBattle(QString name)
61 m_Battles[name]["Friendly"]["Home Planet"];
62 m_Battles[name]["Hostile"];
65 emit documentChanged();
69 /////////////////////////////////////////////////////////////////////////
72 const std::map<QString, std::map<QString, std::map<QString, Fleet> > >& BSDoc::battles() const
77 //////////////////////////////////////////////////////////////////////////
79 Fleet BSDoc::specificFleet(QString battle, QString group, QString fleet) const
81 for (map<QString, map<QString, map<QString, Fleet> > >::const_iterator i = m_Battles.begin(); i != m_Battles.end(); ++i)
83 if (i->first == battle)
85 for (map<QString, map<QString, Fleet> >::const_iterator j = i->second.begin(); j != i->second.end(); j++)
87 if (j->first == group)
89 for (map<QString, Fleet>::const_iterator k = j->second.begin(); k != j->second.end(); ++k)
91 if (k->first == fleet)