#include "bsdoc.h"
+using namespace std;
+
BSDoc::BSDoc()
{
modified = false;
{
return modified;
}
+
+///////////////////////////////////////////////////////////////////////////
+//
+
+int BSDoc::newBattle(QString name)
+{
+ m_Battles[name]["Friendly"]["Home Planet"];
+ m_Battles[name]["Hostile"];
+
+ modified = true;
+ emit documentChanged();
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////
+//
+
+const std::map<QString, std::map<QString, std::map<QString, Fleet> > >& BSDoc::battles() const
+{
+ return m_Battles;
+}
+
+//////////////////////////////////////////////////////////////////////////
+//
+Fleet BSDoc::specificFleet(QString battle, QString group, QString fleet) const
+{
+ for (map<QString, map<QString, map<QString, Fleet> > >::const_iterator i = m_Battles.begin(); i != m_Battles.end(); ++i)
+ {
+ if (i->first == battle)
+ {
+ for (map<QString, map<QString, Fleet> >::const_iterator j = i->second.begin(); j != i->second.end(); j++)
+ {
+ if (j->first == group)
+ {
+ for (map<QString, Fleet>::const_iterator k = j->second.begin(); k != j->second.end(); ++k)
+ {
+ if (k->first == fleet)
+ {
+ return k->second;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+