summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Boeckel <MathStuf@gmail.com>2008-11-25 19:27:52 -0500
committerBen Boeckel <MathStuf@gmail.com>2008-11-25 19:27:52 -0500
commitcefbda7c847be408fb3b2668c1b209de677ebc1a (patch)
treed76b82cbf3ad362998c6366ccce008341af05d0f
parent96d075092ebf009a98f4eea98f68b216b9bf01c3 (diff)
downloadsigen-cefbda7c847be408fb3b2668c1b209de677ebc1a.tar.gz
sigen-cefbda7c847be408fb3b2668c1b209de677ebc1a.tar.xz
sigen-cefbda7c847be408fb3b2668c1b209de677ebc1a.zip
CoinList documentation
-rw-r--r--sigmod/CoinList.h117
1 files changed, 117 insertions, 0 deletions
diff --git a/sigmod/CoinList.h b/sigmod/CoinList.h
index cd0482b9..d515defb 100644
--- a/sigmod/CoinList.h
+++ b/sigmod/CoinList.h
@@ -15,6 +15,10 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+/**
+ * \file sigmod/CoinList.h
+ */
+
#ifndef SIGMOD_COINLIST
#define SIGMOD_COINLIST
@@ -33,38 +37,151 @@ namespace Sigmod
class CoinListObject;
class Sigmod;
+/**
+ * \class Sigmod::CoinList CoinList.h sigmod/CoinList.h
+ * \brief A coin list contains a list of objects that can be bought using coins.
+ *
+ * The difference between a coin list and a \link Store store \endlink is that team members
+ * cannot be bought at stores. Since money is typically easier to come by than coins are,
+ * things that appear in a coin list tend to be rare and valuable.
+ */
class SIGMOD_EXPORT CoinList : public Object
{
Q_OBJECT
public:
+ /**
+ * Copy constructor.
+ *
+ * \param coinList The coin list to copy.
+ */
CoinList(const CoinList& coinList);
+ /**
+ * Create a new ability belonging to \p parent and id \p id.
+ *
+ * \param parent The parent of the coin list.
+ * \param id The id number for the coin list.
+ */
CoinList(const Sigmod* parent, const int id);
+ /**
+ * Data copy constructor. Copies the data from \p coinList as a child of \p parent with id \p id.
+ *
+ * \param coinList The coin list to copy the data from.
+ * \param parent The parent of the coin list.
+ * \param id The id number for the coin list.
+ */
CoinList(const CoinList& coinList, 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 coin list.
+ * \param id The id number for the coin list.
+ */
CoinList(const QDomElement& xml, const Sigmod* parent, const int id = -1);
+ /**
+ * Destructor.
+ */
~CoinList();
+ /**
+ * Check to make sure the coin list's values are valid.
+ * \note This does not check the script 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 coin list in XML format.
+ *
+ * \return The XML structure representing the coin list.
+ */
QDomElement save() const;
+ /**
+ * The name of the coin list. This is only used internally.
+ *
+ * \param name The name of the coin list.
+ */
void setName(const QString& name);
+ /**
+ *
+ * \param script The script that gets executed when the player activates the list.
+ */
void setScript(const Sigcore::Script& script);
+ /**
+ * \sa setName
+ *
+ * \return The name of the coin list.
+ */
QString name() const;
+ /**
+ * \sa setScript
+ *
+ * \return The script for the coin list.
+ */
Sigcore::Script script() const;
+ /**
+ * \param index The index of the object to get.
+ * \return Pointer to the object or NULL if \p index is invalid.
+ */
const CoinListObject* object(const int index) const;
+ /**
+ * \param index The index of the object to get.
+ * \return Pointer to the object or NULL if \p index is invalid.
+ */
CoinListObject* object(const int index);
+ /**
+ * \param id The id of the object to get.
+ * \return Pointer to the object or NULL if \p id is invalid.
+ */
const CoinListObject* objectById(const int id) const;
+ /**
+ * \param id The id of the object to get.
+ * \return Pointer to the object or NULL if \p id is invalid.
+ */
CoinListObject* objectById(const int id);
+ /**
+ * \param id The id of the object to get.
+ * \return The index of the object or INT_MAX if \p id is invalid.
+ */
int objectIndex(const int id) const;
+ /**
+ * \return The number of objects in the coin list.
+ */
int objectCount() const;
+ /**
+ * \return Pointer to a newly created object.
+ */
CoinListObject* newObject();
+ /**
+ * \param xml The XML of the object to add.
+ * \return Pointer to a newly created object from \p xml.
+ */
CoinListObject* newObject(const QDomElement& xml);
+ /**
+ * \param object A copy of the object to add.
+ * \return Pointer to a newly created object from \p object.
+ */
CoinListObject* newObject(const CoinListObject& object);
+ /**
+ * Deletes the object at index \p index.
+ *
+ * \param index The index of the object to delete.
+ */
void deleteObject(const int index);
+ /**
+ * Deletes the object with id \p id.
+ *
+ * \param id The id of the object to delete.
+ */
void deleteObjectById(const int id);
CoinList& operator=(const CoinList& rhs);