X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=bs%2Fbsdoc.h;h=4cd0ee6d9a28cbb6a479e21ed0672472b2007404;hb=e0be1e6e8f7a246acf49e1f315c8d5bc5a65bfa3;hp=3cca9c34290db51fdbe32578c210e48c21e44787;hpb=ea21b4f48454fef675d3d1990269e9d7f4c16e99;p=hbs.git diff --git a/bs/bsdoc.h b/bs/bsdoc.h index 3cca9c3..4cd0ee6 100644 --- a/bs/bsdoc.h +++ b/bs/bsdoc.h @@ -26,6 +26,7 @@ // application specific includes #include "fleet.h" +typedef std::map > > BattleList; //! The document class /** This class is holding all the data, handles the transportation of the * data to a couple of different mediums and informs users of the data @@ -40,7 +41,7 @@ class BSDoc : public QObject Q_OBJECT public: - BSDoc(); + BSDoc(); ~BSDoc(); void newDoc(); bool save(); @@ -58,8 +59,25 @@ class BSDoc : public QObject * change it. * \todo remove this, and replace it with a better more closed interface. */ - std::map > >& Battles(); + const BattleList& battles() const; + + /**Looks for the fleet with the specified name, in the specified group in the + * specified battle. + * \return Returns '\0' (NULL) if the fleet isn't found, if it is found it + * returns a const pointer to the fleet. + */ + const Fleet* specificFleet(QString battle, QString group, QString fleet) const; + + void changeFleet(QString battle, QString group, QString fleet, const Fleet* fl); + + void newFleet(QString battle, QString group, QString fleet, Fleet* fl); + + void removeFleet(QString battle, QString group, QString fleet); + + void runBattleSimulation(); + + void parseScan(); signals: void documentChanged(); @@ -73,7 +91,7 @@ class BSDoc : public QObject * -# The fleetname (Home Planet, coordinates, irc nicks and so on) * - and in the end you got the actual Fleet object with it's data. */ - std::map > > m_Battles; + BattleList m_Battles; }; #endif