mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
server/entity: Add CCollision() getter
The main idea is to sync prediction and server CEntity APIs.
This commit is contained in:
parent
a023671ecd
commit
f934882e51
|
@ -11,6 +11,7 @@
|
|||
CEntity::CEntity(CGameWorld *pGameWorld, int ObjType, vec2 Pos, int ProximityRadius)
|
||||
{
|
||||
m_pGameWorld = pGameWorld;
|
||||
m_pCCollision = GameServer()->Collision();
|
||||
|
||||
m_ObjType = ObjType;
|
||||
m_Pos = Pos;
|
||||
|
|
|
@ -9,6 +9,8 @@
|
|||
#include "gamecontext.h"
|
||||
#include "gameworld.h"
|
||||
|
||||
class CCollision;
|
||||
|
||||
/*
|
||||
Class: Entity
|
||||
Basic entity class.
|
||||
|
@ -24,6 +26,7 @@ private:
|
|||
|
||||
/* Identity */
|
||||
class CGameWorld *m_pGameWorld;
|
||||
CCollision *m_pCCollision;
|
||||
|
||||
int m_ID;
|
||||
int m_ObjType;
|
||||
|
@ -59,6 +62,7 @@ public: // TODO: Maybe make protected
|
|||
class CConfig *Config() { return m_pGameWorld->Config(); }
|
||||
class CGameContext *GameServer() { return m_pGameWorld->GameServer(); }
|
||||
class IServer *Server() { return m_pGameWorld->Server(); }
|
||||
CCollision *Collision() { return m_pCCollision; }
|
||||
|
||||
/* Getters */
|
||||
CEntity *TypeNext() { return m_pNextTypeEntity; }
|
||||
|
|
Loading…
Reference in a new issue