mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-28 15:45:41 +03:00
Refactoring ReGame-API
This commit is contained in:
parent
ab4a8437ce
commit
d75089461c
@ -268,7 +268,10 @@ public:
|
||||
virtual int GetMinorVersion() = 0;
|
||||
virtual const ReGameFuncs_t* GetFuncs() = 0;
|
||||
virtual IReGameHookchains* GetHookchains() = 0;
|
||||
virtual IReGameData* GetGameData() = 0;
|
||||
|
||||
virtual class CGameRules* GetGameRules() = 0;
|
||||
virtual struct WeaponInfoStruct *GetWeaponInfo(int weaponID) = 0;
|
||||
virtual struct playermove_s *GetPlayerMove() = 0;
|
||||
|
||||
};
|
||||
|
||||
|
@ -2071,12 +2071,3 @@ public:
|
||||
virtual void Spawn() = 0;
|
||||
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
|
||||
};
|
||||
|
||||
class IReGameData {
|
||||
public:
|
||||
virtual ~IReGameData() {}
|
||||
|
||||
virtual class CGameRules* GetGameRules() = 0;
|
||||
virtual struct WeaponInfoStruct *GetWeaponInfo(int weaponID) = 0;
|
||||
virtual struct playermove_s *GetPlayerMove() = 0;
|
||||
};
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "precompiled.h"
|
||||
|
||||
CReGameHookchains g_ReGameHookchains;
|
||||
CReGameData g_ReGameData;
|
||||
|
||||
ReGameFuncs_t g_ReGameApiFuncs = {
|
||||
&UTIL_PlayerByIndex,
|
||||
@ -113,9 +112,16 @@ IReGameHookchains *CReGameApi::GetHookchains()
|
||||
return &g_ReGameHookchains;
|
||||
}
|
||||
|
||||
IReGameData *CReGameApi::GetGameData()
|
||||
{
|
||||
return &g_ReGameData;
|
||||
CGameRules* EXT_FUNC CReGameApi::GetGameRules() {
|
||||
return g_pGameRules;
|
||||
}
|
||||
|
||||
WeaponInfoStruct* EXT_FUNC CReGameApi::GetWeaponInfo(int weaponID) {
|
||||
return ::GetWeaponInfo(weaponID);
|
||||
}
|
||||
|
||||
playermove_t* EXT_FUNC CReGameApi::GetPlayerMove() {
|
||||
return pmove;
|
||||
}
|
||||
|
||||
void EXT_FUNC Regamedll_ChangeString_api(char *&dest, const char *source)
|
||||
|
@ -279,7 +279,6 @@ public:
|
||||
};
|
||||
|
||||
extern CReGameHookchains g_ReGameHookchains;
|
||||
extern CReGameData g_ReGameData;
|
||||
extern ReGameFuncs_t g_ReGameApiFuncs;
|
||||
|
||||
class CReGameApi: public IReGameApi {
|
||||
@ -289,7 +288,10 @@ public:
|
||||
|
||||
virtual const ReGameFuncs_t *GetFuncs();
|
||||
virtual IReGameHookchains *GetHookchains();
|
||||
virtual IReGameData* GetGameData();
|
||||
|
||||
virtual CGameRules* GetGameRules();
|
||||
virtual WeaponInfoStruct *GetWeaponInfo(int weaponID);
|
||||
virtual playermove_t *GetPlayerMove();
|
||||
};
|
||||
|
||||
void Regamedll_ChangeString_api(char *&dest, const char *source);
|
||||
|
@ -134,15 +134,3 @@ ICSEntity *EXT_FUNC INDEX_TO_CSENTITY(int iEntityIndex)
|
||||
CBaseEntity *pEntity = CBaseEntity::Instance(INDEXENT(iEntityIndex));
|
||||
return CBASE_TO_CSENTITY(pEntity);
|
||||
}
|
||||
|
||||
CGameRules* EXT_FUNC CReGameData::GetGameRules() {
|
||||
return g_pGameRules;
|
||||
}
|
||||
|
||||
WeaponInfoStruct* EXT_FUNC CReGameData::GetWeaponInfo(int weaponID) {
|
||||
return ::GetWeaponInfo(weaponID);
|
||||
}
|
||||
|
||||
playermove_t* EXT_FUNC CReGameData::GetPlayerMove() {
|
||||
return pmove;
|
||||
}
|
||||
|
@ -2520,13 +2520,6 @@ public:
|
||||
virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); }
|
||||
};
|
||||
|
||||
class CReGameData: public IReGameData {
|
||||
public:
|
||||
virtual CGameRules* GetGameRules();
|
||||
virtual WeaponInfoStruct *GetWeaponInfo(int weaponID);
|
||||
virtual playermove_t *GetPlayerMove();
|
||||
};
|
||||
|
||||
template <class T>
|
||||
inline T *Regamedll_InitializeEntities(CBaseEntity *a)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user