[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/games/kscoremanager
From: Matt Williams <matt () milliams ! com>
Date: 2008-05-01 0:16:28
Message-ID: 1209600988.995778.21302.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 802886 by milliams:
- Prettify apidox
- Remove assigned numbers for the enum. QFlags will deal with that
M +1 -1 kscoreboardgraphicswidget.h
M +39 -14 kscoremanager.h
--- trunk/playground/games/kscoremanager/kscoreboardgraphicswidget.h #802885:802886
@@ -28,7 +28,7 @@
#include <kscoremanager.h>
/**
- * \class KScoreBoardGraphicsWidget kscoreboardgraphicswiget.h <KScoreBoardGraphicsWidget>
+ * \class KScoreBoardGraphicsWidget kscoreboardgraphicswidget.h <KScoreBoardGraphicsWidget>
*
* \brief A QGraphicsWidget based highscore table
*
--- trunk/playground/games/kscoremanager/kscoremanager.h #802885:802886
@@ -41,6 +41,8 @@
* for adding scores to various groups as well as displaying the resultant
* highscore table.
*
+ * <h4>Basic Operation</h4>
+ *
* It is a singleton and so requires no setup for the basic tasks. At the
* simplest, you can show the highscore table with
* \code
@@ -61,6 +63,8 @@
* which will display the table with the most recently added score highlighted
* and a message congratulating/commiserating the player for their performance.
*
+ * <h4>Passing Detailed Information</h4>
+ *
* You can pass in more information than just the player's score by passing
* addScore() a ScoreInfo object. You can build up the ScoreInfo object with
* the relevant information and then submit it:
@@ -70,6 +74,7 @@
* scoreInfo[KScoreDialog::Score] = playerScore; //the player's score (int)
* KScoreManager::self()->addScore(scoreInfo);
* \endcode
+ *
* If you want to display more than just name and score (e.g. level or time
* taken) you can do the following:
* \code
@@ -86,6 +91,9 @@
* KScoreBoardDialog board();
* board.show(KScoreDialog::HighlightLastScore | KScoreDialog::DisplayMessage);
* \endcode
+ *
+ * <h4>Custom Fields</h4>
+ *
* If you wish to define your own custom fields, you can do so with the
* addField() function. You add it into one of the custom fields and set the UI
* string. Note that you must both call addField() and set it to be displayed
@@ -108,6 +116,8 @@
* board.show(KScoreDialog::HighlightLastScore | KScoreDialog::DisplayMessage);
* \endcode
*
+ * <h4>Grouping Scores</h4>
+ *
* So far all the examples have been adding the score to the default group. You
* can group your scores (e.g. based on the difficulty of the level). Note that
* you must always addScoreGroupName() for all groups that scould exist in your
@@ -125,16 +135,20 @@
* board.show(KScoreDialog::HighlightLastScore | KScoreDialog::DisplayMessage);
* \endcode
*
+ * <h4>Specific Settings</h4>
+ *
* There are two functions which globally set properties:
* \code
* KScoreManager::self()->setOption(KScoreManager::DoNotAskName |
- * KScoreManager::LessIsMore);
+ * KScoreManager::LowerScoreIsBetter);
* \endcode
* This will make the UI never ask the user for their name. Make sure you pass
* a name via a ScoreInfo call to addScore() or the default name from KUser
* will be used. The second flag will make lower scores be placed higher on the
* scoreboard than higher scores.
*
+ * <h4>Outcome Messages</h3>
+ *
* Finally, you can set custom messages to be displayed when the dialog is
* shown. There are three possible situations define by OutcomeFlag and you can
* set a custom message for any of them. All the outcomes have default messages,
@@ -147,18 +161,21 @@
* //for this outcome
* \endcode
*
+ *
* \since KDE 4.2
* \author Matt Williams <matt@milliams.com>
*/
-class KDEGAMES_EXPORT KScoreManager : public QObject
+class KDEGAMES_EXPORT KScoreManager
{
public:
/**
- * \enum OptionFlag
+ * \enum Option
*
* \brief General option flags
*
* This provides the values for the \a Options flag set
+ *
+ * \see setOptions()
*/
enum Option
{
@@ -173,6 +190,8 @@
* \brief The possible outcomes
*
* This provides the values for the \a Outcome flag set
+ *
+ * \see setMessage()
*/
enum OutcomeFlag
{
@@ -190,6 +209,9 @@
* This provides the values for the \a ScoreDisplay flag set
*
* \note This should probably be moved into the UI class?
+ *
+ * \see KScoreBoardDialog
+ * \see KScoreBoardGraphicsWidget
*/
enum ScoreDisplayFlag
{
@@ -209,20 +231,21 @@
* mapping. This would allow for almost completely free key additions.
*
* This provides the values for the \a Fields flag set
+ *
+ * \see addField()
*/
enum Field
{
- Name = 1 << 0, ///<Name of the player
- Level = 1 << 1, ///<The level of the game achieved
- Date = 1 << 2, ///<Today's date
- Time = 1 << 3, ///<The time taken to complete the game or level
- Score = 1 << 4, ///<The player's score
- Custom1 = 1 << 10, ///<Field for custom information
- Custom2 = 1 << 11,
- Custom3 = 1 << 12,
- Custom4 = 1 << 13,
- Custom5 = 1 << 14,
- Max = 1 << 30 ///<Only for setting a maximum
+ Name, ///<Name of the player
+ Level, ///<The level of the game achieved
+ Date, ///<Today's date
+ Time, ///<The time taken to complete the game or level
+ Score, ///<The player's score
+ Custom1, ///<Field for custom information
+ Custom2, ///<Field for custom information
+ Custom3, ///<Field for custom information
+ Custom4, ///<Field for custom information
+ Custom5 ///<Field for custom information
};
Q_DECLARE_FLAGS(Fields, Field)
@@ -230,6 +253,8 @@
* \typedef ScoreInfo
*
* A map of key and values for the score
+ *
+ * \see addScore()
*/
typedef QMap<Field, QVariant> ScoreInfo;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic