File: InfoTagGame.cpp

package info (click to toggle)
kodi 2%3A20.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 143,820 kB
  • sloc: cpp: 664,925; xml: 68,398; ansic: 37,223; python: 6,903; sh: 4,209; javascript: 2,325; makefile: 1,754; perl: 969; java: 513; cs: 390; objc: 340
file content (172 lines) | stat: -rw-r--r-- 3,705 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
/*
 *  Copyright (C) 2021 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#include "InfoTagGame.h"

#include "AddonUtils.h"
#include "games/tags/GameInfoTag.h"

using namespace KODI::GAME;
using namespace XBMCAddonUtils;

namespace XBMCAddon
{
namespace xbmc
{

InfoTagGame::InfoTagGame(bool offscreen /* = false */)
  : infoTag(new CGameInfoTag), offscreen(offscreen), owned(true)
{
}

InfoTagGame::InfoTagGame(const CGameInfoTag* tag)
  : infoTag(new CGameInfoTag(*tag)), offscreen(true), owned(true)
{
}

InfoTagGame::InfoTagGame(CGameInfoTag* tag, bool offscreen /* = false */)
  : infoTag(tag), offscreen(offscreen), owned(false)
{
}

InfoTagGame::~InfoTagGame()
{
  if (owned)
    delete infoTag;
}

String InfoTagGame::getTitle()
{
  return infoTag->GetTitle();
}

String InfoTagGame::getPlatform()
{
  return infoTag->GetPlatform();
}

std::vector<String> InfoTagGame::getGenres()
{
  return infoTag->GetGenres();
}

String InfoTagGame::getPublisher()
{
  return infoTag->GetPublisher();
}

String InfoTagGame::getDeveloper()
{
  return infoTag->GetDeveloper();
}

String InfoTagGame::getOverview()
{
  return infoTag->GetOverview();
}

unsigned int InfoTagGame::getYear()
{
  return infoTag->GetYear();
}

String InfoTagGame::getGameClient()
{
  return infoTag->GetGameClient();
}

void InfoTagGame::setTitle(const String& title)
{
  XBMCAddonUtils::GuiLock lock(languageHook, offscreen);
  setTitleRaw(infoTag, title);
}

void InfoTagGame::setPlatform(const String& platform)
{
  XBMCAddonUtils::GuiLock lock(languageHook, offscreen);
  setPlatformRaw(infoTag, platform);
}

void InfoTagGame::setGenres(const std::vector<String>& genres)
{
  XBMCAddonUtils::GuiLock lock(languageHook, offscreen);
  setGenresRaw(infoTag, genres);
}

void InfoTagGame::setPublisher(const String& publisher)
{
  XBMCAddonUtils::GuiLock lock(languageHook, offscreen);
  setPublisherRaw(infoTag, publisher);
}

void InfoTagGame::setDeveloper(const String& developer)
{
  XBMCAddonUtils::GuiLock lock(languageHook, offscreen);
  setDeveloperRaw(infoTag, developer);
}

void InfoTagGame::setOverview(const String& overview)
{
  XBMCAddonUtils::GuiLock lock(languageHook, offscreen);
  setOverviewRaw(infoTag, overview);
}

void InfoTagGame::setYear(unsigned int year)
{
  XBMCAddonUtils::GuiLock lock(languageHook, offscreen);
  setYearRaw(infoTag, year);
}

void InfoTagGame::setGameClient(const String& gameClient)
{
  XBMCAddonUtils::GuiLock lock(languageHook, offscreen);
  setGameClientRaw(infoTag, gameClient);
}

void InfoTagGame::setTitleRaw(KODI::GAME::CGameInfoTag* infoTag, const String& title)
{
  infoTag->SetTitle(title);
}

void InfoTagGame::setPlatformRaw(KODI::GAME::CGameInfoTag* infoTag, const String& platform)
{
  infoTag->SetPlatform(platform);
}

void InfoTagGame::setGenresRaw(KODI::GAME::CGameInfoTag* infoTag, const std::vector<String>& genres)
{
  infoTag->SetGenres(genres);
}

void InfoTagGame::setPublisherRaw(KODI::GAME::CGameInfoTag* infoTag, const String& publisher)
{
  infoTag->SetPublisher(publisher);
}

void InfoTagGame::setDeveloperRaw(KODI::GAME::CGameInfoTag* infoTag, const String& developer)
{
  infoTag->SetDeveloper(developer);
}

void InfoTagGame::setOverviewRaw(KODI::GAME::CGameInfoTag* infoTag, const String& overview)
{
  infoTag->SetOverview(overview);
}

void InfoTagGame::setYearRaw(KODI::GAME::CGameInfoTag* infoTag, unsigned int year)
{
  infoTag->SetYear(year);
}

void InfoTagGame::setGameClientRaw(KODI::GAME::CGameInfoTag* infoTag, const String& gameClient)
{
  infoTag->SetGameClient(gameClient);
}

} // namespace xbmc
} // namespace XBMCAddon