diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2009-01-17 12:41:15 -0500 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2009-01-17 12:41:15 -0500 |
| commit | 90a58741db511b19d575e6b82761c7170ad5f2c8 (patch) | |
| tree | 4adc3d13bafa96c3838d0d24c35e5a5698b7b3d5 | |
| parent | 45e783093bf5a0cf0d8e59a5ca1c6172153afebd (diff) | |
Added Sprite documentation
| -rw-r--r-- | sigmod/Sprite.cpp | 4 | ||||
| -rw-r--r-- | sigmod/Sprite.h | 69 |
2 files changed, 73 insertions, 0 deletions
diff --git a/sigmod/Sprite.cpp b/sigmod/Sprite.cpp index e1a33b5e..22a39d23 100644 --- a/sigmod/Sprite.cpp +++ b/sigmod/Sprite.cpp @@ -15,6 +15,10 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +/** + * \file sigmod/Sprite.cpp + */ + // Header include #include "Sprite.h" diff --git a/sigmod/Sprite.h b/sigmod/Sprite.h index b142437d..2ee25493 100644 --- a/sigmod/Sprite.h +++ b/sigmod/Sprite.h @@ -15,6 +15,10 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +/** + * \file sigmod/Sprite.h + */ + #ifndef SIGMOD_SPRITE #define SIGMOD_SPRITE @@ -29,25 +33,90 @@ namespace Sigmod // Forward declarations class Sigmod; +/** + * \class Sigmod::Sprite Sprite.h sigmod/Sprite.h + * \brief Class for holding an image. + * + * This class is used to hold an image and give it a name for easy reference. + */ class SIGMOD_EXPORT Sprite : public Object { Q_OBJECT public: + /** + * Copy constructor. + * + * \param sprite The sprite to copy. + */ Sprite(const Sprite& sprite); + /** + * Create a new sprite belonging to \p parent and id \p id. + * + * \param parent The parent of the sprite. + * \param id The id number for the sprite. + */ Sprite(const Sigmod* parent, const int id); + /** + * Data copy constructor. Copies the data from \p sprite as a child of \p parent with id \p id. + * + * \param sprite The sprite to copy the data from. + * \param parent The parent of the sprite. + * \param id The id number for the sprite. + */ Sprite(const Sprite& sprite, const Sigmod* parent, const int id); + /** + * XML data constructor. + * + * \param xml The XML structure to extract the data from. + * \param parent The parent of the sprite. + * \param id The id number for the sprite. + */ Sprite(const QDomElement& xml, const Sigmod* parent, const int id = -1); + /** + * Check to make sure the sprite's values are valid. + */ void validate(); + /** + * Load data from XML. + * + * \param xml The XML structure to extract data from. + */ void load(const QDomElement& xml); + /** + * Get the data for the ability in XML format. + * + * \return The XML structure representing the sprite. + */ QDomElement save() const; + /** + * Sets the name of the sprite. This is only used internally. + * + * \param name The name of the sprite. + */ void setName(const QString& name); + /** + * Sets the data for the sprite. When stored, it will be base64 encoded to ensure that no + * non-printable characters appear in the sigmod file. + * + * \param sprite The data for the sprite. + */ void setSprite(const QByteArray& sprite); + /** + * \sa setName + * + * \return The name of the skin. + */ QString name() const; + /** + * \sa setSprite + * + * \return The data for the sprite. + */ QByteArray sprite() const; bool nameCheck(const QString& name) const; |
