summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-01-17 12:22:08 -0500
committerBen Boeckel <MathStuf@gmail.com>2009-01-17 12:22:08 -0500
commit2b590db5df706f2d8b4795163b0c977fc83bd4b2 (patch)
tree5c842627f9cfc58148f8a6e84bc2c6c0334d5bb8
parentad88625beabb7c19c7b7f946d45b617ee7f892ec (diff)
downloadsigen-2b590db5df706f2d8b4795163b0c977fc83bd4b2.tar.gz
sigen-2b590db5df706f2d8b4795163b0c977fc83bd4b2.tar.xz
sigen-2b590db5df706f2d8b4795163b0c977fc83bd4b2.zip
Added docmentation to Skin
-rw-r--r--sigmod/Skin.cpp6
-rw-r--r--sigmod/Skin.h73
2 files changed, 77 insertions, 2 deletions
diff --git a/sigmod/Skin.cpp b/sigmod/Skin.cpp
index 7cd906fb..ca5384d1 100644
--- a/sigmod/Skin.cpp
+++ b/sigmod/Skin.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2008 Ben Boeckel <MathStuf@gmail.com>
+ * Copyright 2008-2009 Ben Boeckel <MathStuf@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,6 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * \file sigmod/Skin.cpp
+ */
+
// Header include
#include "Skin.h"
diff --git a/sigmod/Skin.h b/sigmod/Skin.h
index a5369aab..04e55006 100644
--- a/sigmod/Skin.h
+++ b/sigmod/Skin.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2008 Ben Boeckel <MathStuf@gmail.com>
+ * Copyright 2008-2009 Ben Boeckel <MathStuf@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,6 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * \file sigmod/Skin.h
+ */
+
#ifndef SIGMOD_SKIN
#define SIGMOD_SKIN
@@ -34,20 +38,87 @@ class SIGMOD_EXPORT Skin : public Object
Q_OBJECT
public:
+ /**
+ * Copy constructor.
+ *
+ * \param skin The skin to copy.
+ */
Skin(const Skin& skin);
+ /**
+ * Create a new skin belonging to \p parent and id \p id.
+ *
+ * \param parent The parent of the skin.
+ * \param id The id number for the skin.
+ */
Skin(const Sigmod* parent, const int id);
+ /**
+ * Data copy constructor. Copies the data from \p skin as a child of \p parent with id \p id.
+ *
+ * \param skin The skin to copy the data from.
+ * \param parent The parent of the skin.
+ * \param id The id number for the skin.
+ */
Skin(const Skin& skin, 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 skin.
+ * \param id The id number for the skin.
+ */
Skin(const QDomElement& xml, const Sigmod* parent, const int id = -1);
+ /**
+ * Check to make sure the skin's values are valid.
+ * \note This does not check the scripts for validity.
+ */
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 skin in XML format.
+ *
+ * \return The XML structure representing the skin.
+ */
QDomElement save() const;
+ /**
+ * Sets the name of the skin. This is only used internally.
+ *
+ * \param name The name of the skin
+ */
void setName(const QString& name);
+ /**
+ * Sets the script that manages the images for the skin. The following objects will be available
+ * to the script:
+ *
+ * - \b item -- The \link Sigworld::MapItem \endlink the skin controls the images for.
+ * - \b sigmod -- The \link Sigscript::SigmodWrapper wrapper \endlink for the \link Sigmod sigmod \endlink in use.
+ * - \b world -- The \link Sigworld::Map map \endlink for the \link Map map \endlink the map item is on.
+ *
+ * The \b item object will have signals for when it moves and for when it stops. This script should connect to the
+ * signals and modify the image for it as it moves.
+ *
+ * \param script The script that controls the skin.
+ */
void setScript(const Sigcore::Script& script);
+ /**
+ * \sa setName
+ *
+ * \return The name of the skin.
+ */
QString name() const;
+ /**
+ * \sa setSkin
+ *
+ * \return The script for the skin.
+ */
Sigcore::Script script() const;
bool nameCheck(const QString& name) const;