diff options
| author | Ben Boeckel <MathStuf@gmail.com> | 2008-12-25 10:16:32 -0500 |
|---|---|---|
| committer | Ben Boeckel <MathStuf@gmail.com> | 2008-12-25 10:16:32 -0500 |
| commit | a3363f088a14d2ab0fcbeb75652127c1d418758b (patch) | |
| tree | 6c76a37edef6df363ec6003944d9651333899442 | |
| parent | b831770f0118e965d15af2dc6a460550c709e1d5 (diff) | |
Documented Item
| -rw-r--r-- | sigmod/ItemType.cpp | 4 | ||||
| -rw-r--r-- | sigmod/ItemType.h | 105 | ||||
| -rw-r--r-- | sigmodr/gui/itemtype.ui | 6 |
3 files changed, 112 insertions, 3 deletions
diff --git a/sigmod/ItemType.cpp b/sigmod/ItemType.cpp index e18b8c82..f8394c0b 100644 --- a/sigmod/ItemType.cpp +++ b/sigmod/ItemType.cpp @@ -15,6 +15,10 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +/** + * \file sigmod/ItemType.cpp + */ + // Header include #include "ItemType.h" diff --git a/sigmod/ItemType.h b/sigmod/ItemType.h index b3f48c7e..fa3efae3 100644 --- a/sigmod/ItemType.h +++ b/sigmod/ItemType.h @@ -15,6 +15,10 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +/** + * \file sigmod/ItemType.h + */ + #ifndef SIGMOD_ITEMTYPE #define SIGMOD_ITEMTYPE @@ -26,39 +30,140 @@ namespace Sigmod // Forward declarations class Sigmod; +/** + * \class Sigmod::ItemType ItemType.h sigmod/ItemType.h + * \brief A + */ class SIGMOD_EXPORT ItemType : public Object { Q_OBJECT Q_ENUMS(Count) public: + /** + * \enum Count + * \brief The ways items can be counted. + */ enum Count { Distinct = 0, Total = 1 }; + /** + * \var CountStr + * String values for the ways count of an item. + */ static QStringList CountStr; + /** + * Copy constructor. + * + * \param itemType The type to copy. + */ ItemType(const ItemType& itemType); + /** + * Create a new type belonging to \p parent and id \p id. + * + * \param parent The parent of the type. + * \param id The id number for the type. + */ ItemType(const Sigmod* parent, const int id); + /** + * Data copy constructor. Copies the data from \p itemType as a child of \p parent with id \p id. + * + * \param itemType The type to copy the data from. + * \param parent The parent of the type. + * \param id The id number for the type. + */ ItemType(const ItemType& itemType, 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 type. + * \param id The id number for the type. + */ ItemType(const QDomElement& xml, const Sigmod* parent, const int id = -1); + /** + * Check to make sure the type'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 item in XML format. + * + * \return The XML structure representing the type. + */ QDomElement save() const; + /** + * Sets the name of the type. + * + * \param name The name of the type. + */ void setName(const QString& name); + /** + * Sets the number of items that can be stored in the computer at one time. + * + * \param computer The number of items of this type that can be stored in the computer at once. + */ void setComputer(const int computer); + /** + * Sets the number of items that can can be carried by the player at one time. + * + * \param player number of items of this type that can be carried by the player at once. + */ void setPlayer(const int player); + /** + * Sets the maximum weight of items of this type that can be carried at once. + * + * \param maxWeight The maximum weight of items of this type that can be carried. + */ void setMaxWeight(const int maxWeight); + /** + * Sets the way items count towards their maximum count. If \p Distinct is used, items stack and multiples + * of the same item only count once. With \p Total, each item counts towards the limit. + * + * \param count The way items of this type contribute towards the maximum count. + */ void setCount(const Count count); + /** + * \sa setName + * + * \return The name of the type. + */ QString name() const; + /** + * \sa setComputer + * + * \return The number of items of this type that can be stored in the computer at once. + */ int computer() const; + /** + * \sa setPlayer + * + * \return The number of items of this type that can be carried by the player at once. + */ int player() const; + /** + * \sa setMaxWeight + * + * \return The maximum weight of items of this type that can be carried. + */ int maxWeight() const; + /** + * \sa setCount + * + * \return The way items of this type contribute towards the maximum count. + */ Count count() const; ItemType& operator=(const ItemType& rhs); diff --git a/sigmodr/gui/itemtype.ui b/sigmodr/gui/itemtype.ui index 9f1b70ee..9327c1a2 100644 --- a/sigmodr/gui/itemtype.ui +++ b/sigmodr/gui/itemtype.ui @@ -8,13 +8,13 @@ <string>Name</string> </property> <property name="toolTip" > - <string>Name of the item type (internal use only)</string> + <string>Name of the item type</string> </property> <property name="statusTip" > - <string>Name of the item type (internal use only)</string> + <string>Name of the item type</string> </property> <property name="whatsThis" > - <string>Name of the item type (internal use only)</string> + <string>Name of the item type</string> </property> <layout class="QHBoxLayout" > <item> |
