2012-07-20 16:14:09 +00:00
|
|
|
#ifndef _GAMEDATA_H_
|
|
|
|
#define _GAMEDATA_H_
|
|
|
|
|
|
|
|
#include <string>
|
2013-06-28 15:25:18 +00:00
|
|
|
#include <ctime>
|
|
|
|
|
2012-07-27 16:58:27 +00:00
|
|
|
#include "FileData.h"
|
2012-07-20 16:14:09 +00:00
|
|
|
#include "SystemData.h"
|
|
|
|
|
2012-09-07 21:44:07 +00:00
|
|
|
//This class holds information about a game: at the least, its name, system, and path. Additional information is optional and read by other classes.
|
2012-07-27 16:58:27 +00:00
|
|
|
class GameData : public FileData
|
2012-07-20 16:14:09 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-06-28 12:54:14 +00:00
|
|
|
//static tag names for reading/writing XML documents. This might fail in PUGIXML_WCHAR_MODE
|
|
|
|
//TODO: The class should have member to read fromXML() and write toXML() probably...
|
|
|
|
static const std::string xmlTagGameList;
|
|
|
|
static const std::string xmlTagGame;
|
|
|
|
static const std::string xmlTagName;
|
|
|
|
static const std::string xmlTagPath;
|
|
|
|
static const std::string xmlTagDescription;
|
|
|
|
static const std::string xmlTagImagePath;
|
|
|
|
static const std::string xmlTagRating;
|
2013-06-28 15:25:18 +00:00
|
|
|
static const std::string xmlTagUserRating;
|
2013-06-28 12:54:14 +00:00
|
|
|
static const std::string xmlTagTimesPlayed;
|
2013-06-28 15:25:18 +00:00
|
|
|
static const std::string xmlTagLastPlayed;
|
2013-06-28 12:54:14 +00:00
|
|
|
|
2012-07-20 16:14:09 +00:00
|
|
|
GameData(SystemData* system, std::string path, std::string name);
|
|
|
|
|
2013-06-28 12:54:14 +00:00
|
|
|
const std::string & getName() const;
|
|
|
|
void setName(const std::string & name);
|
|
|
|
|
|
|
|
const std::string & getPath() const;
|
|
|
|
void setPath(const std::string & path);
|
|
|
|
|
|
|
|
const std::string & getDescription() const;
|
|
|
|
void setDescription(const std::string & description);
|
|
|
|
|
|
|
|
const std::string & getImagePath() const;
|
|
|
|
void setImagePath(const std::string & imagePath);
|
|
|
|
|
2013-06-28 14:13:57 +00:00
|
|
|
float getRating() const;
|
|
|
|
void setRating(float rating);
|
2012-08-02 01:43:55 +00:00
|
|
|
|
2013-06-28 15:25:18 +00:00
|
|
|
float getUserRating() const;
|
|
|
|
void setUserRating(float rating);
|
|
|
|
|
2013-06-28 12:54:14 +00:00
|
|
|
size_t getTimesPlayed() const;
|
|
|
|
void setTimesPlayed(size_t timesPlayed);
|
2012-08-02 01:43:55 +00:00
|
|
|
|
2013-06-28 15:25:18 +00:00
|
|
|
std::time_t getLastPlayed() const;
|
|
|
|
void setLastPlayed(std::time_t lastPlayed);
|
|
|
|
|
2013-06-28 12:54:14 +00:00
|
|
|
std::string getBashPath() const;
|
|
|
|
std::string getBaseName() const;
|
2012-08-02 01:43:55 +00:00
|
|
|
|
2013-06-28 12:54:14 +00:00
|
|
|
bool isFolder() const;
|
2012-07-20 16:14:09 +00:00
|
|
|
private:
|
|
|
|
SystemData* mSystem;
|
|
|
|
std::string mPath;
|
|
|
|
std::string mName;
|
2012-08-02 01:43:55 +00:00
|
|
|
|
|
|
|
//extra data
|
|
|
|
std::string mDescription;
|
|
|
|
std::string mImagePath;
|
2013-06-28 14:13:57 +00:00
|
|
|
float mRating;
|
2013-06-28 15:25:18 +00:00
|
|
|
float mUserRating;
|
2013-06-28 12:54:14 +00:00
|
|
|
size_t mTimesPlayed;
|
2013-06-28 15:25:18 +00:00
|
|
|
std::time_t mLastPlayed;
|
2012-07-20 16:14:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|