| 1 |
/* |
| 2 |
* Copyright (C) 2012-2018 Team Kodi |
| 3 |
* This file is part of Kodi - https://kodi.tv |
| 4 |
* |
| 5 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 6 |
* See LICENSES/README.md for more information. |
| 7 |
*/ |
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include "utils/IArchivable.h" |
| 12 |
#include "utils/ISerializable.h" |
| 13 |
#include "utils/ISortable.h" |
| 14 |
|
| 15 |
#include <string> |
| 16 |
|
| 17 |
namespace KODI |
| 18 |
{ |
| 19 |
namespace GAME |
| 20 |
{ |
| 21 |
/*! |
| 22 |
* \ingroup games |
| 23 |
*/ |
| 24 |
class CGameInfoTag : public IArchivable, public ISerializable, public ISortable |
| 25 |
{ |
| 26 |
public: |
| 27 |
CGameInfoTag() { Reset(); } |
| 28 |
CGameInfoTag(const CGameInfoTag& tag) { *this = tag; } |
| 29 |
CGameInfoTag& operator=(const CGameInfoTag& tag); |
| 30 |
virtual ~CGameInfoTag() = default; |
| 31 |
void Reset(); |
| 32 |
|
| 33 |
bool operator==(const CGameInfoTag& tag) const; |
| 34 |
bool operator!=(const CGameInfoTag& tag) const { return !(*this == tag); } |
| 35 |
|
| 36 |
bool IsLoaded() const { return m_bLoaded; } |
| 37 |
void SetLoaded(bool bOnOff = true) { m_bLoaded = bOnOff; } |
| 38 |
|
| 39 |
// File path |
| 40 |
const std::string& GetURL() const { return m_strURL; } |
| 41 |
void SetURL(const std::string& strURL) { m_strURL = strURL; } |
| 42 |
|
| 43 |
// Title |
| 44 |
const std::string& GetTitle() const { return m_strTitle; } |
| 45 |
void SetTitle(const std::string& strTitle) { m_strTitle = strTitle; } |
| 46 |
|
| 47 |
// Platform |
| 48 |
const std::string& GetPlatform() const { return m_strPlatform; } |
| 49 |
void SetPlatform(const std::string& strPlatform) { m_strPlatform = strPlatform; } |
| 50 |
|
| 51 |
// Genres |
| 52 |
const std::vector<std::string>& GetGenres() const { return m_genres; } |
| 53 |
void SetGenres(const std::vector<std::string>& genres) { m_genres = genres; } |
| 54 |
|
| 55 |
// Developer |
| 56 |
const std::string& GetDeveloper() const { return m_strDeveloper; } |
| 57 |
void SetDeveloper(const std::string& strDeveloper) { m_strDeveloper = strDeveloper; } |
| 58 |
|
| 59 |
// Overview |
| 60 |
const std::string& GetOverview() const { return m_strOverview; } |
| 61 |
void SetOverview(const std::string& strOverview) { m_strOverview = strOverview; } |
| 62 |
|
| 63 |
// Year |
| 64 |
unsigned int GetYear() const { return m_year; } |
| 65 |
void SetYear(unsigned int year) { m_year = year; } |
| 66 |
|
| 67 |
// Game Code (ID) |
| 68 |
const std::string& GetID() const { return m_strID; } |
| 69 |
void SetID(const std::string& strID) { m_strID = strID; } |
| 70 |
|
| 71 |
// Region |
| 72 |
const std::string& GetRegion() const { return m_strRegion; } |
| 73 |
void SetRegion(const std::string& strRegion) { m_strRegion = strRegion; } |
| 74 |
|
| 75 |
// Publisher / Licensee |
| 76 |
const std::string& GetPublisher() const { return m_strPublisher; } |
| 77 |
void SetPublisher(const std::string& strPublisher) { m_strPublisher = strPublisher; } |
| 78 |
|
| 79 |
// Format (PAL/NTSC) |
| 80 |
const std::string& GetFormat() const { return m_strFormat; } |
| 81 |
void SetFormat(const std::string& strFormat) { m_strFormat = strFormat; } |
| 82 |
|
| 83 |
// Cartridge Type, e.g. "ROM+MBC5+RAM+BATT" or "CD" |
| 84 |
const std::string& GetCartridgeType() const { return m_strCartridgeType; } |
| 85 |
void SetCartridgeType(const std::string& strCartridgeType) |
| 86 |
{ |
| 87 |
m_strCartridgeType = strCartridgeType; |
| 88 |
} |
| 89 |
|
| 90 |
// Game client add-on ID |
| 91 |
const std::string& GetGameClient() const { return m_strGameClient; } |
| 92 |
void SetGameClient(const std::string& strGameClient) { m_strGameClient = strGameClient; } |
| 93 |
|
| 94 |
void Archive(CArchive& ar) override; |
| 95 |
void Serialize(CVariant& value) const override; |
| 96 |
void ToSortable(SortItem& sortable, Field field) const override; |
| 97 |
|
| 98 |
private: |
| 99 |
bool m_bLoaded; |
| 100 |
std::string m_strURL; |
| 101 |
std::string m_strTitle; |
| 102 |
std::string m_strPlatform; |
| 103 |
std::vector<std::string> m_genres; |
| 104 |
std::string m_strDeveloper; |
| 105 |
std::string m_strOverview; |
| 106 |
unsigned int m_year; |
| 107 |
std::string m_strID; |
| 108 |
std::string m_strRegion; |
| 109 |
std::string m_strPublisher; |
| 110 |
std::string m_strFormat; |
| 111 |
std::string m_strCartridgeType; |
| 112 |
std::string m_strGameClient; |
| 113 |
}; |
| 114 |
} // namespace GAME |
| 115 |
} // namespace KODI |