prediction/entity: Sync constructor signature, add GetProximityRadius()

This commit is contained in:
Alexander Akulich 2022-05-28 21:11:16 +03:00
parent a5f4c66fd5
commit a023671ecd
2 changed files with 5 additions and 3 deletions

View file

@ -6,12 +6,13 @@
//////////////////////////////////////////////////
// Entity
//////////////////////////////////////////////////
CEntity::CEntity(CGameWorld *pGameWorld, int ObjType)
CEntity::CEntity(CGameWorld *pGameWorld, int ObjType, vec2 Pos, int ProximityRadius)
{
m_pGameWorld = pGameWorld;
m_ObjType = ObjType;
m_ProximityRadius = 0;
m_Pos = Pos;
m_ProximityRadius = ProximityRadius;
m_MarkedForDestroy = false;
m_ID = -1;

View file

@ -38,7 +38,7 @@ protected:
int m_ObjType;
public:
CEntity(CGameWorld *pGameWorld, int Objtype);
CEntity(CGameWorld *pGameWorld, int Objtype, vec2 Pos = vec2(0, 0), int ProximityRadius = 0);
virtual ~CEntity();
class CGameWorld *GameWorld() { return m_pGameWorld; }
@ -48,6 +48,7 @@ public:
class CCollision *Collision() { return GameWorld()->Collision(); }
CEntity *TypeNext() { return m_pNextTypeEntity; }
CEntity *TypePrev() { return m_pPrevTypeEntity; }
float GetProximityRadius() const { return m_ProximityRadius; }
void Destroy() { delete this; }
virtual void Tick() {}