+//////////////////////////////////////////////////////////////////////////
+//
+const Fleet* BSDoc::specificFleet(QString battle, QString group, QString fleet) const
+{
+ for (BattleList::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;
+ }
+ }
+ }
+ }
+ }
+ }
+ return '\0';
+}
+
+//////////////////////////////////////////////////////////////////////////
+//
+void BSDoc::changeFleet(QString battle, QString group, QString fleet, const Fleet* fl)
+{
+ delete m_Battles[battle][group][fleet];
+
+ const Planet* planet = 0;
+ if((planet = dynamic_cast<const Planet*>(fl)))
+ {
+ m_Battles[battle][group][fleet] = new Planet(*planet);
+ }
+ else
+ {
+ m_Battles[battle][group][fleet] = new Fleet(*fl);
+ }
+ emit documentChanged();
+}
+
+
+//////////////////////////////////////////////////////////////////////////
+//
+void BSDoc::newFleet(QString battle, QString group, QString fleet, Fleet* fl)
+{
+ m_Battles[battle][group][fleet] = fl;
+ emit documentChanged();
+}
+
+//////////////////////////////////////////////////////////////////////////
+//
+void BSDoc::removeFleet(QString battle, QString group, QString fleet)
+{
+ delete m_Battles[battle][group][fleet];
+ m_Battles[battle][group].erase(fleet);
+ emit documentChanged();
+}
+
+//////////////////////////////////////////////////////////////////////////
+//
+void BSDoc::runBattleSimulation()
+{
+
+ emit documentChanged();
+}