UserProfileDatabase Class Reference
#include <userprofiledatabase.h>
List of all members.
Detailed Description
This is the database of user profiles.
When a database is loaded it contains the information on what profiles we are tracking, and how well they're playing each game. The database is stored in the system specific location.
- Todo:
- Create an enumerated list for the range of emotions for the players.
- Author:
- John Schneiderman
Constructor & Destructor Documentation
UserProfileDatabase::UserProfileDatabase |
( |
|
) |
|
UserProfileDatabase::~UserProfileDatabase |
( |
|
) |
|
Member Function Documentation
QString UserProfileDatabase::cardBackImageFilename |
( |
|
) |
const |
This retrieves the image to use for the back of the cards.
- Note:
- The information is pulled from the user settings file.
- Returns:
- the stored file-name for the image to use on the back of the card, if not found "back00.png" is returned.
pair< int, int > UserProfileDatabase::gameStatistics |
( |
const QString & |
game |
) |
const |
An accessor to a users game statistics.
- Parameters:
-
| game | is the name of the game we want the statistics for. |
- Returns:
- A pair whose first value is the number of games won, and whose second value is the number of games played.
QString UserProfileDatabase::pathToCardFrontImages |
( |
|
) |
const |
This retrieves the path to the directory that has the card images.
- Note:
- The information is pulled from the user settings file.
- Returns:
- the stored path to the directory, if not found default is returned.
void UserProfileDatabase::setCardBackImageFilename |
( |
const QString & |
image |
) |
|
This stores the file-name for the card back image.
- Parameters:
-
void UserProfileDatabase::setGameStatistics |
( |
const QString & |
game, |
|
|
bool |
won | |
|
) |
| | |
Updates the game statistics for a user, if the game statistics file doesn't exist one is created.
- Note:
- If the game statistic file is not found, one will be created.
- Parameters:
-
| game | is the name of the game we want to update the statistics for. |
| won | is true if the user has won the game, false if he has lost. |
void UserProfileDatabase::setPathToCardFrontImages |
( |
const QString & |
path |
) |
|
This stores the path to the directory for the card front images.
- Parameters:
-
| path | is the path to the directory that contains all the front images for the cards. |
void UserProfileDatabase::setUserMoodImage |
( |
const QString & |
mood, |
|
|
const QString & |
filename | |
|
) |
| | |
This stores the image file-name to use for a specific mood.
- Parameters:
-
| mood | is the mood depicted in the image. |
| filename | is the file-name of the image. |
void UserProfileDatabase::setUserName |
( |
const QString & |
userName |
) |
|
This stores the user's name.
- Parameters:
-
| userName | is the user's name to store. |
QString UserProfileDatabase::userMoodImage |
( |
const QString & |
mood = "NeutralMood" |
) |
const |
This retrieves the image to use for the user.
- Note:
- The information is found in the user settings file.
- Parameters:
-
| mood | is the mood of the image we're getting. |
- Returns:
- the stored player's image file-name, if not found player-male.png is returned.
QString UserProfileDatabase::userName |
( |
|
) |
const |
An accessor to the user's name.
- Returns:
- the user's name.
The documentation for this class was generated from the following files:
- gamebase/userprofiledatabase.h
- gamebase/userprofiledatabase.cpp