-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathf_component.h
37 lines (30 loc) · 1.35 KB
/
f_component.h
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
#pragma once
#include "game/client/gameclient.h"
#define LOCAL g_Config.m_ClDummy
#define LOCAL_ID m_pClient->m_aLocalIds[LOCAL]
#define DUMMY !g_Config.m_ClDummy
#define DUMMY_ID m_pClient->m_aLocalIds[DUMMY]
#define PHYS_SIZE 28.f
#define MAX_HITPOINTS 32
class FComponent
{
public:
FComponent(CGameClient* pClient) :
m_pClient(pClient){}
virtual ~FComponent() = default;
protected:
// CGameClient pointer
CGameClient* m_pClient;
// Game classes pointers
[[nodiscard]] CGameClient* GameClient() const { return m_pClient; }
[[nodiscard]] CControls* Controls() const { return &m_pClient->m_Controls; }
[[nodiscard]] IConsole* Console() const { return m_pClient->Console(); }
[[nodiscard]] IInput* Input() const { return m_pClient->Input(); }
[[nodiscard]] CCollision* Collision() const { return m_pClient->Collision(); }
[[nodiscard]] IClient* Client() const { return m_pClient->Client(); }
[[nodiscard]] IGraphics* Graphics() const { return m_pClient->Graphics(); }
[[nodiscard]] CGameWorld* GameWorld() const { return &m_pClient->m_GameWorld; }
[[nodiscard]] CGameWorld* PredGameWorld() const { return &m_pClient->m_PredictedWorld; }
[[nodiscard]] CTuningParams* Tuning() const { return m_pClient->m_aTuning; }
[[nodiscard]] IServerBrowser* ServerBrowser() const { return m_pClient->ServerBrowser(); }
};