X-Git-Url: https://ruin.nu/git/?p=hbs.git;a=blobdiff_plain;f=bs%2Fbsdoc.h;h=5cf0001e33716fd8b5f7012bd88f6028ccbcdb2d;hp=6ff9216fffef2bdb70133bf71f5f7020154dfa18;hb=dc90594097a886eee49e9bfe45da6d4f9765179a;hpb=ec7ebf4a9acd1d7b7e4e7967c4afa94300ed5ff9 diff --git a/bs/bsdoc.h b/bs/bsdoc.h index 6ff9216..5cf0001 100644 --- a/bs/bsdoc.h +++ b/bs/bsdoc.h @@ -20,30 +20,60 @@ // include files for QT #include +// standard library +#include + // application specific includes +#include "fleet.h" -/** - * the Document Class +//! 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 + * if it's changed (through the documentChnaged() signal) + * \bug it's too open.. + * \todo make this class more closed. + * \author Michael Andreen */ -class BcDoc : public QObject +class BSDoc : public QObject { Q_OBJECT public: - BcDoc(); - ~BcDoc(); + BSDoc(); + ~BSDoc(); void newDoc(); bool save(); bool saveAs(const QString &filename); bool load(const QString &filename); bool isModified() const; + /**Adds a new battle to the dokument and emits documentChanged. + * \todo add some checks to see if the battle exist and so and return the status. + * \return returns 0 if everything is ok. + */ + int newBattle(QString name); + + /**This returns the the data structure, so other can work on it, but not supposed + * change it. + * \todo remove this, and replace it with a better more closed interface. + */ + std::map > >& Battles(); + signals: void documentChanged(); protected: bool modified; + + /**This is the main datastructure of the battlecalc, it's more or less the + * core that everything else works around. A short explanation of the fields: + * -# The name of the battle (usually coordinates) + * -# The name of the group (ie. Friendly/Hostile) + * -# 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; }; #endif