Skip to content

Commit

Permalink
Fix CIcEntity class and files name
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaffeine committed Dec 14, 2024
1 parent 2b4609b commit 8952b20
Show file tree
Hide file tree
Showing 34 changed files with 75 additions and 75 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,8 @@ set_glob(GAME_SERVER GLOB_RECURSE src/game/server
infclass/entities/hero-flag.h
infclass/entities/ic-pickup.cpp
infclass/entities/ic-pickup.h
infclass/entities/ic_entity.cpp
infclass/entities/ic_entity.h
infclass/entities/ic_projectile.cpp
infclass/entities/ic_projectile.h
infclass/entities/infc-laser.cpp
Expand All @@ -912,8 +914,6 @@ set_glob(GAME_SERVER GLOB_RECURSE src/game/server
infclass/entities/infc-placed-object.h
infclass/entities/infccharacter.cpp
infclass/entities/infccharacter.h
infclass/entities/infcentity.cpp
infclass/entities/infcentity.h
infclass/entities/laser-teleport.cpp
infclass/entities/laser-teleport.h
infclass/entities/looper-wall.cpp
Expand Down
6 changes: 3 additions & 3 deletions src/game/server/infclass/entities/bouncing-bullet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
int CBouncingBullet::EntityId{};

CBouncingBullet::CBouncingBullet(CGameContext *pGameContext, int Owner, vec2 Pos, vec2 Dir)
: CInfCEntity(pGameContext, EntityId, Pos, Owner)
: CIcEntity(pGameContext, EntityId, Pos, Owner)
{
m_ActualPos = Pos;
m_ActualDir = Dir;
Expand All @@ -36,14 +36,14 @@ vec2 CBouncingBullet::GetPos(float Time)

void CBouncingBullet::TickPaused()
{
CInfCEntity::TickPaused();
CIcEntity::TickPaused();

m_StartTick++;
}

void CBouncingBullet::Tick()
{
CInfCEntity::Tick();
CIcEntity::Tick();

if(IsMarkedForDestroy())
return;
Expand Down
4 changes: 2 additions & 2 deletions src/game/server/infclass/entities/bouncing-bullet.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#ifndef GAME_SERVER_ENTITIES_BOUNCINGBULLET_H
#define GAME_SERVER_ENTITIES_BOUNCINGBULLET_H

#include "infcentity.h"
#include "ic_entity.h"

class CBouncingBullet : public CInfCEntity
class CBouncingBullet : public CIcEntity
{
public:
static int EntityId;
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/infclass/entities/engineer-wall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <game/server/infclass/snap_filter.h>

#include "engineer-wall.h"
#include "game/server/infclass/entities/infcentity.h"
#include "game/server/infclass/entities/ic_entity.h"
#include "infccharacter.h"

static const float g_BarrierMaxLength = 300.0;
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/infclass/entities/flyingpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
int CFlyingPoint::EntityId;

CFlyingPoint::CFlyingPoint(CGameContext *pGameContext, vec2 Pos, int TrackedPlayer, int Points, vec2 InitialVel)
: CInfCEntity(pGameContext, EntityId, Pos, TrackedPlayer, 24.0f)
: CIcEntity(pGameContext, EntityId, Pos, TrackedPlayer, 24.0f)
{
m_InitialVel = InitialVel;
m_Points = Points;
Expand Down
4 changes: 2 additions & 2 deletions src/game/server/infclass/entities/flyingpoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#ifndef GAME_SERVER_ENTITIES_FLYINGPOINT_H
#define GAME_SERVER_ENTITIES_FLYINGPOINT_H

#include "infcentity.h"
#include "ic_entity.h"

class CFlyingPoint : public CInfCEntity
class CFlyingPoint : public CIcEntity
{
public:
static int EntityId;
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/infclass/entities/growingexplosion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ CGrowingExplosion::CGrowingExplosion(CGameContext *pGameContext, vec2 Pos, vec2
}

CGrowingExplosion::CGrowingExplosion(CGameContext *pGameContext, vec2 Pos, vec2 Dir, int Owner, int Radius, EDamageType DamageType) :
CInfCEntity(pGameContext, EntityId, Pos, Owner),
CIcEntity(pGameContext, EntityId, Pos, Owner),
m_MaxGrowing(Radius),
m_DamageType(DamageType)
{
Expand Down
4 changes: 2 additions & 2 deletions src/game/server/infclass/entities/growingexplosion.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef GAME_SERVER_ENTITIES_GROWINGEXPLOSION_H
#define GAME_SERVER_ENTITIES_GROWINGEXPLOSION_H

#include "infcentity.h"
#include "ic_entity.h"

#include <game/server/entity.h>
#include <game/server/entities/character.h>
Expand All @@ -25,7 +25,7 @@ enum class EGrowingExplosionEffect
HEAL_HUMANS,
};

class CGrowingExplosion : public CInfCEntity
class CGrowingExplosion : public CIcEntity
{
public:
static int EntityId;
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/infclass/entities/hero-flag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
int CHeroFlag::EntityId{};

CHeroFlag::CHeroFlag(CGameContext *pGameContext, int Owner)
: CInfCEntity(pGameContext, EntityId, vec2(), Owner, ms_PhysSize)
: CIcEntity(pGameContext, EntityId, vec2(), Owner, ms_PhysSize)
{
for(int &Id : m_Ids)
{
Expand Down
4 changes: 2 additions & 2 deletions src/game/server/infclass/entities/hero-flag.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
#ifndef GAME_SERVER_ENTITIES_HEROFLAG_H
#define GAME_SERVER_ENTITIES_HEROFLAG_H

#include "infcentity.h"
#include "ic_entity.h"

class CInfClassCharacter;

class CHeroFlag : public CInfCEntity
class CHeroFlag : public CIcEntity
{
public:
static int EntityId;
Expand Down
6 changes: 3 additions & 3 deletions src/game/server/infclass/entities/ic-pickup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
int CIcPickup::EntityId = CGameWorld::ENTTYPE_PICKUP;

CIcPickup::CIcPickup(CGameContext *pGameContext, EICPickupType Type, vec2 Pos, int Owner) :
CInfCEntity(pGameContext, EntityId, Pos, Owner, PickupPhysSize)
CIcEntity(pGameContext, EntityId, Pos, Owner, PickupPhysSize)
{
m_Type = Type;
m_SpawnTick = -1;
Expand All @@ -39,7 +39,7 @@ CIcPickup::CIcPickup(CGameContext *pGameContext, EICPickupType Type, vec2 Pos, i
void CIcPickup::Reset()
{
if(HasOwner())
CInfCEntity::Reset();
CIcEntity::Reset();

m_SpawnTick = -1;
}
Expand All @@ -59,7 +59,7 @@ void CIcPickup::Tick()
return;
}

CInfCEntity::Tick();
CIcEntity::Tick();

// Check if a player intersected us
CInfClassCharacter *pChr = nullptr;
Expand Down
4 changes: 2 additions & 2 deletions src/game/server/infclass/entities/ic-pickup.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef GAME_SERVER_IC_ENTITIES_PICKUP_H
#define GAME_SERVER_IC_ENTITIES_PICKUP_H

#include "infcentity.h"
#include "ic_entity.h"

#include <base/tl/ic_array.h>

Expand All @@ -19,7 +19,7 @@ enum class EICPickupType

struct SClassUpgrade;

class CIcPickup : public CInfCEntity
class CIcPickup : public CIcEntity
{
public:
static int EntityId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "infcentity.h"
#include "ic_entity.h"

#include <base/tl/ic_array.h>

Expand All @@ -12,7 +12,7 @@ static icArray<const CEntity *, 10> aFilterEntities;

static bool OwnerFilter(const CEntity *pEntity)
{
const CInfCEntity *pInfEntity = static_cast<const CInfCEntity *>(pEntity);
const CIcEntity *pInfEntity = static_cast<const CIcEntity *>(pEntity);
return pInfEntity->GetOwner() == FilterOwnerId;
}

Expand All @@ -21,20 +21,20 @@ static bool ExceptEntitiesFilter(const CEntity *pEntity)
return !aFilterEntities.Contains(pEntity);
}

CInfCEntity::CInfCEntity(CGameContext *pGameContext, int ObjectType, vec2 Pos, std::optional<int> Owner,
CIcEntity::CIcEntity(CGameContext *pGameContext, int ObjectType, vec2 Pos, std::optional<int> Owner,
int ProximityRadius) :
CEntity(pGameContext->GameWorld(), ObjectType, Pos, ProximityRadius)
{
dbg_assert(ObjectType != 0, "Invalid ObjectType. Ensure that the type is registered via RegisterEntityType().");
SetOwner(Owner.value_or(-1));
}

CInfClassGameController *CInfCEntity::GameController() const
CInfClassGameController *CIcEntity::GameController() const
{
return static_cast<CInfClassGameController*>(GameServer()->m_pController);
}

void CInfCEntity::SetOwner(int ClientId)
void CIcEntity::SetOwner(int ClientId)
{
if(ClientId < 0)
{
Expand All @@ -46,12 +46,12 @@ void CInfCEntity::SetOwner(int ClientId)
}
}

CInfClassCharacter *CInfCEntity::GetOwnerCharacter() const
CInfClassCharacter *CIcEntity::GetOwnerCharacter() const
{
return GameController()->GetCharacter(GetOwner());
}

CInfClassPlayerClass *CInfCEntity::GetOwnerClass() const
CInfClassPlayerClass *CIcEntity::GetOwnerClass() const
{
CInfClassCharacter *pCharacter = GetOwnerCharacter();
if (pCharacter)
Expand All @@ -60,29 +60,29 @@ CInfClassPlayerClass *CInfCEntity::GetOwnerClass() const
return nullptr;
}

EntityFilter CInfCEntity::GetOwnerFilterFunction(int Owner)
EntityFilter CIcEntity::GetOwnerFilterFunction(int Owner)
{
FilterOwnerId = Owner;
return OwnerFilter;
}

EntityFilter CInfCEntity::GetOwnerFilterFunction()
EntityFilter CIcEntity::GetOwnerFilterFunction()
{
return GetOwnerFilterFunction(GetOwner());
}

EntityFilter CInfCEntity::GetExceptEntitiesFilterFunction(const icArray<const CEntity *, 10> &aEntities)
EntityFilter CIcEntity::GetExceptEntitiesFilterFunction(const icArray<const CEntity *, 10> &aEntities)
{
aFilterEntities = aEntities;
return ExceptEntitiesFilter;
}

void CInfCEntity::Reset()
void CIcEntity::Reset()
{
GameWorld()->DestroyEntity(this);
}

void CInfCEntity::Tick()
void CIcEntity::Tick()
{
if(m_EndTick.has_value() && (Server()->Tick() >= m_EndTick))
{
Expand All @@ -100,25 +100,25 @@ void CInfCEntity::Tick()
}
}

void CInfCEntity::TickPaused()
void CIcEntity::TickPaused()
{
if (m_EndTick.has_value())
++m_EndTick.value();
}

void CInfCEntity::SetPos(const vec2 &Position)
void CIcEntity::SetPos(const vec2 &Position)
{
m_Pos = Position;
}

void CInfCEntity::SetAnimatedPos(const vec2 &Pivot, const vec2 &RelPosition, int PosEnv)
void CIcEntity::SetAnimatedPos(const vec2 &Pivot, const vec2 &RelPosition, int PosEnv)
{
m_Pivot = Pivot;
m_RelPosition = RelPosition;
m_PosEnv = PosEnv;
}

float CInfCEntity::GetLifespan() const
float CIcEntity::GetLifespan() const
{
if (!m_EndTick.has_value())
return -1;
Expand All @@ -127,25 +127,25 @@ float CInfCEntity::GetLifespan() const
return RemainingTicks <= 0 ? 0 : RemainingTicks / static_cast<float>(Server()->TickSpeed());
}

void CInfCEntity::SetLifespan(float Lifespan)
void CIcEntity::SetLifespan(float Lifespan)
{
m_EndTick = Server()->Tick() + Server()->TickSpeed() * Lifespan;
}

void CInfCEntity::ResetLifespan()
void CIcEntity::ResetLifespan()
{
m_EndTick.reset();
}

bool CInfCEntity::DoSnapForClient(int SnappingClient)
bool CIcEntity::DoSnapForClient(int SnappingClient)
{
if(NetworkClipped(SnappingClient))
return false;

return true;
}

void CInfCEntity::SyncPosition()
void CIcEntity::SyncPosition()
{
vec2 Position(0.0f, 0.0f);
float Angle = 0.0f;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ class CInfClassPlayerClass;

using EntityFilter = bool (*)(const CEntity *);

class CInfCEntity : public CEntity
class CIcEntity : public CEntity
{
public:
CInfCEntity(CGameContext *pGameContext, int ObjectType, vec2 Pos = vec2(), std::optional<int> Owner = std::nullopt,
CIcEntity(CGameContext *pGameContext, int ObjectType, vec2 Pos = vec2(), std::optional<int> Owner = std::nullopt,
int ProximityRadius = 0);

CInfClassGameController *GameController() const;
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/infclass/entities/ic_projectile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int CIcProjectile::EntityId{};

CIcProjectile::CIcProjectile(CGameContext *pGameContext, int Type, int Owner, vec2 Pos, vec2 Dir, int Span,
int Damage, bool Explosive, float Force, int SoundImpact, EDamageType DamageType)
: CInfCEntity(pGameContext, EntityId, Pos, Owner)
: CIcEntity(pGameContext, EntityId, Pos, Owner)
{
m_Type = Type;
m_Direction = Dir;
Expand Down
4 changes: 2 additions & 2 deletions src/game/server/infclass/entities/ic_projectile.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

#include <game/server/infclass/entities/infcentity.h>
#include <game/server/infclass/entities/ic_entity.h>

enum class TAKEDAMAGEMODE;
enum class EDamageType;

class CIcProjectile : public CInfCEntity
class CIcProjectile : public CIcEntity
{
public:
static int EntityId;
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/infclass/entities/infc-laser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <game/server/infclass/infcgamecontroller.h>

CInfClassLaser::CInfClassLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Dmg, EInfclassWeapon InfClassWeapon) :
CInfCEntity(pGameContext, CGameWorld::ENTTYPE_LASER, Pos, Owner), m_Weapon(InfClassWeapon)
CIcEntity(pGameContext, CGameWorld::ENTTYPE_LASER, Pos, Owner), m_Weapon(InfClassWeapon)
{
m_Dmg = Dmg;
m_Energy = StartEnergy;
Expand Down
4 changes: 2 additions & 2 deletions src/game/server/infclass/entities/infc-laser.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
#ifndef GAME_SERVER_INFCLASS_ENTITIES_LASER_H
#define GAME_SERVER_INFCLASS_ENTITIES_LASER_H

#include "infcentity.h"
#include "ic_entity.h"

struct WeaponFireContext;
enum class EDamageType;
enum class EInfclassWeapon;

class CInfClassLaser : public CInfCEntity
class CInfClassLaser : public CIcEntity
{
public:
CInfClassLaser(CGameContext *pGameContext, vec2 Pos, vec2 Direction, float StartEnergy, int Owner, int Dmg, EInfclassWeapon InfClassWeapon);
Expand Down
Loading

0 comments on commit 8952b20

Please sign in to comment.