1#include "component.h"
2
3#include "gameclient.h"
4
5#include <base/system.h>
6
7void CComponentInterfaces::OnInterfacesInit(CGameClient *pClient)
8{
9 dbg_assert(m_pClient == nullptr, "Component already initialized");
10 m_pClient = pClient;
11}
12
13class IKernel *CComponentInterfaces::Kernel() const
14{
15 return m_pClient->Kernel();
16}
17
18class IEngine *CComponentInterfaces::Engine() const
19{
20 return m_pClient->Engine();
21}
22
23class IGraphics *CComponentInterfaces::Graphics() const
24{
25 return m_pClient->Graphics();
26}
27
28class ITextRender *CComponentInterfaces::TextRender() const
29{
30 return m_pClient->TextRender();
31}
32
33class IInput *CComponentInterfaces::Input() const
34{
35 return m_pClient->Input();
36}
37
38class IStorage *CComponentInterfaces::Storage() const
39{
40 return m_pClient->Storage();
41}
42
43class CUi *CComponentInterfaces::Ui() const
44{
45 return m_pClient->Ui();
46}
47
48class ISound *CComponentInterfaces::Sound() const
49{
50 return m_pClient->Sound();
51}
52
53class CRenderTools *CComponentInterfaces::RenderTools() const
54{
55 return m_pClient->RenderTools();
56}
57
58class CRenderMap *CComponentInterfaces::RenderMap() const
59{
60 return m_pClient->RenderMap();
61}
62
63class IConfigManager *CComponentInterfaces::ConfigManager() const
64{
65 return m_pClient->ConfigManager();
66}
67
68class CConfig *CComponentInterfaces::Config() const
69{
70 return m_pClient->Config();
71}
72
73class IConsole *CComponentInterfaces::Console() const
74{
75 return m_pClient->Console();
76}
77
78class IDemoPlayer *CComponentInterfaces::DemoPlayer() const
79{
80 return m_pClient->DemoPlayer();
81}
82
83class IDemoRecorder *CComponentInterfaces::DemoRecorder(int Recorder) const
84{
85 return m_pClient->DemoRecorder(Recorder);
86}
87
88class IFavorites *CComponentInterfaces::Favorites() const
89{
90 return m_pClient->Favorites();
91}
92
93class IServerBrowser *CComponentInterfaces::ServerBrowser() const
94{
95 return m_pClient->ServerBrowser();
96}
97
98class CLayers *CComponentInterfaces::Layers() const
99{
100 return m_pClient->Layers();
101}
102
103class CCollision *CComponentInterfaces::Collision() const
104{
105 return m_pClient->Collision();
106}
107
108#if defined(CONF_AUTOUPDATE)
109class IUpdater *CComponentInterfaces::Updater() const
110{
111 return m_pClient->Updater();
112}
113#endif
114
115int64_t CComponentInterfaces::time() const
116{
117#if defined(CONF_VIDEORECORDER)
118 return IVideo::Current() ? IVideo::Time() : time_get();
119#else
120 return time_get();
121#endif
122}
123
124float CComponentInterfaces::LocalTime() const
125{
126#if defined(CONF_VIDEORECORDER)
127 return IVideo::Current() ? IVideo::LocalTime() : Client()->LocalTime();
128#else
129 return Client()->LocalTime();
130#endif
131}
132
133class IClient *CComponentInterfaces::Client() const
134{
135 return m_pClient->Client();
136}
137
138class IHttp *CComponentInterfaces::Http() const
139{
140 return m_pClient->Http();
141}
142