summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2009-01-18 18:57:54 -0500
committerBen Boeckel <MathStuf@gmail.com>2009-01-18 18:57:54 -0500
commit0ec979ead999cafbc1e2e881e07fe25c78e64652 (patch)
tree291de94b51b61a8e8c5fff3a8ded7e180dc81d9b
parente30ee1a42fef0346b57333de118d9f3ca18bfa84 (diff)
downloadsigen-0ec979ead999cafbc1e2e881e07fe25c78e64652.tar.gz
sigen-0ec979ead999cafbc1e2e881e07fe25c78e64652.tar.xz
sigen-0ec979ead999cafbc1e2e881e07fe25c78e64652.zip
Added MapEffect documentation
-rw-r--r--sigmod/MapEffect.cpp4
-rw-r--r--sigmod/MapEffect.h106
2 files changed, 110 insertions, 0 deletions
diff --git a/sigmod/MapEffect.cpp b/sigmod/MapEffect.cpp
index 66a90dc6..6eb75d62 100644
--- a/sigmod/MapEffect.cpp
+++ b/sigmod/MapEffect.cpp
@@ -15,6 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * \file sigmod/MapEffect.cpp
+ */
+
// Header include
#include "MapEffect.h"
diff --git a/sigmod/MapEffect.h b/sigmod/MapEffect.h
index 5a8a62cc..281e488f 100644
--- a/sigmod/MapEffect.h
+++ b/sigmod/MapEffect.h
@@ -15,6 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * \file sigmod/MapEffect.h
+ */
+
#ifndef SIGMOD_MAPEFFECT
#define SIGMOD_MAPEFFECT
@@ -32,31 +36,133 @@ namespace Sigmod
// Forward declarations
class Map;
+/**
+ * \class Sigmod::MapEffect MapEffect.h sigmod/MapEffect.h
+ * \brief Class describing an effect on a map.
+ *
+ * Effects include NPCs that roam the world map, items that can be found,
+ * as well as any environmental effects that can occur (moving the player around,
+ * traps, or switches).
+ */
class SIGMOD_EXPORT MapEffect : public Object
{
Q_OBJECT
public:
+ /**
+ * Copy constructor.
+ *
+ * \param effect The effect to copy.
+ */
MapEffect(const MapEffect& effect);
+ /**
+ * Create a new effect belonging to \p parent and id \p id.
+ *
+ * \param parent The parent of the effect.
+ * \param id The id number for the effect.
+ */
MapEffect(const Map* parent, const int id);
+ /**
+ * Data copy constructor. Copies the data from \p effect as a child of \p parent with id \p id.
+ *
+ * \param effect The effect to copy the data from.
+ * \param parent The parent of the effect.
+ * \param id The id number for the effect.
+ */
MapEffect(const MapEffect& effect, const Map* parent, const int id);
+ /**
+ * XML data constructor.
+ *
+ * \param xml The XML structure to extract the data from.
+ * \param parent The parent of the effect.
+ * \param id The id number for the effect.
+ */
MapEffect(const QDomElement& xml, const Map* parent, const int id = -1);
+ /**
+ * Check to make sure the effect's values are valid.
+ * \note This does not check the scripts for effect.
+ */
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 effect in XML format.
+ *
+ * \return The XML structure representing the effect.
+ */
QDomElement save() const;
+ /**
+ * Sets the name of the effect. This is only used internally.
+ *
+ * \param name The name of the effect.
+ */
void setName(const QString& name);
+ /**
+ * Sets the starting position of the effect on the map.
+ *
+ * \param position The starting position of the effect.
+ */
void setPosition(const QPoint& position);
+ /**
+ * Sets the id of the skin used to represent the effect on the map.
+ *
+ * \param skin The id of the skin used for the effect.
+ */
void setSkin(const int skin);
+ /**
+ * Sets whether the effect is collidable in the map or not. If not, it can be moved though
+ * regardless of its image.
+ *
+ * \param isGhost Whether the effect can be moved through or not.
+ */
void setIsGhost(const bool isGhost);
+ /**
+ * Sets the script that controls the effect on the map. The following objects are available to the script:
+ *
+ * - \b item -- The \link Sigworld::MapItem map item \endlink that the script controls.
+ * - \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 player is on.
+ *
+ * \param script The script that controls the effect.
+ */
void setScript(const Sigcore::Script& script);
+ /**
+ * \sa setName
+ *
+ * \return The name of the effect.
+ */
QString name() const;
+ /**
+ * \sa setPosition
+ *
+ * \return The starting position of the effect.
+ */
QPoint position() const;
+ /**
+ * \sa setSkin
+ *
+ * \return The id of the skin that represents the effect.
+ */
int skin() const;
+ /**
+ * \sa setIsGhost
+ *
+ * \return Whether the effect can be moved through or not.
+ */
bool isGhost() const;
+ /**
+ * \sa setScript
+ *
+ * \return The script that controls the effect.
+ */
Sigcore::Script script() const;
bool nameCheck(const QString& name) const;