1
0
forked from 0ad/0ad

Fixes macOS warnings after adding final keyword to simulation classes in 3eee3a444d.

Also fixes GLES.

Differential Revision: https://code.wildfiregames.com/D4528
This was SVN commit r26605.
This commit is contained in:
Vladislav Belov 2022-03-07 23:04:11 +00:00
parent 687174e5d9
commit 41f2ab87ed
54 changed files with 676 additions and 676 deletions

View File

@ -848,19 +848,19 @@ void CShaderProgram::VertexAttribPointer(attrib_id_t UNUSED(id), const Renderer:
// These should all be overridden by CShaderProgramGLSL
// (GLES doesn't support any other types of shader program):
void CShaderProgram::VertexPointer(GLint UNUSED(size), GLenum UNUSED(type), GLsizei UNUSED(stride), const void* UNUSED(pointer))
void CShaderProgram::VertexPointer(const Renderer::Backend::Format UNUSED(format), GLsizei UNUSED(stride), const void* UNUSED(pointer))
{
debug_warn("CShaderProgram::VertexPointer should be overridden");
}
void CShaderProgram::NormalPointer(GLenum UNUSED(type), GLsizei UNUSED(stride), const void* UNUSED(pointer))
void CShaderProgram::NormalPointer(const Renderer::Backend::Format UNUSED(format), GLsizei UNUSED(stride), const void* UNUSED(pointer))
{
debug_warn("CShaderProgram::NormalPointer should be overridden");
}
void CShaderProgram::ColorPointer(GLint UNUSED(size), GLenum UNUSED(type), GLsizei UNUSED(stride), const void* UNUSED(pointer))
void CShaderProgram::ColorPointer(const Renderer::Backend::Format UNUSED(format), GLsizei UNUSED(stride), const void* UNUSED(pointer))
{
debug_warn("CShaderProgram::ColorPointer should be overridden");
}
void CShaderProgram::TexCoordPointer(GLenum UNUSED(texture), GLint UNUSED(size), GLenum UNUSED(type), GLsizei UNUSED(stride), const void* UNUSED(pointer))
void CShaderProgram::TexCoordPointer(GLenum UNUSED(texture), const Renderer::Backend::Format UNUSED(format), GLsizei UNUSED(stride), const void* UNUSED(pointer))
{
debug_warn("CShaderProgram::TexCoordPointer should be overridden");
}

View File

@ -881,7 +881,7 @@ public:
return "<a:component type='system'/><empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
m_Worker.Init(GetSimContext().GetScriptInterface());
@ -890,11 +890,11 @@ public:
m_JustDeserialized = false;
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
serialize.NumberU32_Unbounded("num ais", m_Worker.getPlayerSize());
@ -906,7 +906,7 @@ public:
m_Worker.Serialize(serialize.GetStream(), serialize.IsDebug());
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize)
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override
{
Init(paramNode);
@ -920,7 +920,7 @@ public:
m_JustDeserialized = true;
}
virtual void AddPlayer(const std::wstring& id, player_id_t player, u8 difficulty, const std::wstring& behavior)
void AddPlayer(const std::wstring& id, player_id_t player, u8 difficulty, const std::wstring& behavior) override
{
LoadUsedEntityTemplates();
@ -934,17 +934,17 @@ public:
cmpRangeManager->SetLosRevealAll(player, true);
}
virtual void SetRNGSeed(u32 seed)
void SetRNGSeed(u32 seed) override
{
m_Worker.SetRNGSeed(seed);
}
virtual void TryLoadSharedComponent()
void TryLoadSharedComponent() override
{
m_Worker.TryLoadSharedComponent();
}
virtual void RunGamestateInit()
void RunGamestateInit() override
{
const ScriptInterface& scriptInterface = GetSimContext().GetScriptInterface();
ScriptRequest rq(scriptInterface);
@ -981,7 +981,7 @@ public:
*passabilityMap, *territoryMap, nonPathfindingPassClassMasks, pathfindingPassClassMasks);
}
virtual void StartComputation()
void StartComputation() override
{
PROFILE("AI setup");
@ -1040,7 +1040,7 @@ public:
m_JustDeserialized = false;
}
virtual void PushCommands()
void PushCommands() override
{
std::vector<CAIWorker::SCommandSets> commands;
m_Worker.GetCommands(commands);

View File

@ -44,7 +44,7 @@ public:
return "<a:component type='system'/><empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
m_Enabled = false;
m_MapRevealed = false;
@ -53,11 +53,11 @@ public:
m_CurrentPathElapsedTime = fixed::Zero();
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& serializer)
void Serialize(ISerializer& serializer) override
{
serializer.Bool("Enabled", m_Enabled);
serializer.NumberFixed_Unbounded("ElapsedTime", m_ElapsedTime);
@ -73,7 +73,7 @@ public:
serializer.String("PathName", path.GetName(), 1, 128);
}
virtual void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserializer)
void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserializer) override
{
deserializer.Bool("Enabled", m_Enabled);
deserializer.NumberFixed_Unbounded("ElapsedTime", m_ElapsedTime);
@ -107,7 +107,7 @@ public:
SetEnabled(m_Enabled);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -146,7 +146,7 @@ public:
}
}
virtual void AddPath(const CCinemaPath& path)
void AddPath(const CCinemaPath& path) override
{
if (m_Paths.find(path.GetName()) != m_Paths.end())
{
@ -156,7 +156,7 @@ public:
m_Paths[path.GetName()] = path;
}
virtual void AddCinemaPathToQueue(const CStrW& name)
void AddCinemaPathToQueue(const CStrW& name) override
{
if (!HasPath(name))
{
@ -170,27 +170,27 @@ public:
m_TotalTime += m_Paths[name].GetDuration();
}
virtual void Play()
void Play() override
{
SetEnabled(true);
}
virtual void Stop()
void Stop() override
{
SetEnabled(false);
}
virtual bool HasPath(const CStrW& name) const
bool HasPath(const CStrW& name) const override
{
return m_Paths.find(name) != m_Paths.end();
}
virtual void ClearQueue()
void ClearQueue() override
{
m_PathQueue.clear();
}
virtual void DeletePath(const CStrW& name)
void DeletePath(const CStrW& name) override
{
if (!HasPath(name))
{
@ -201,27 +201,27 @@ public:
m_Paths.erase(name);
}
virtual const std::map<CStrW, CCinemaPath>& GetPaths() const
const std::map<CStrW, CCinemaPath>& GetPaths() const override
{
return m_Paths;
}
virtual void SetPaths(const std::map<CStrW, CCinemaPath>& newPaths)
void SetPaths(const std::map<CStrW, CCinemaPath>& newPaths) override
{
m_Paths = newPaths;
}
virtual const std::list<CCinemaPath>& GetQueue() const
const std::list<CCinemaPath>& GetQueue() const override
{
return m_PathQueue;
}
virtual bool IsEnabled() const
bool IsEnabled() const override
{
return m_Enabled;
}
virtual void SetEnabled(bool enabled)
void SetEnabled(bool enabled) override
{
if (m_PathQueue.empty() && enabled)
enabled = false;
@ -246,7 +246,7 @@ public:
m_Enabled = enabled;
}
virtual void PlayQueue(const float deltaRealTime, CCamera* camera)
void PlayQueue(const float deltaRealTime, CCamera* camera) override
{
if (m_PathQueue.empty())
return;

View File

@ -43,15 +43,15 @@ public:
return "<a:component type='system'/><empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
ScriptRequest rq(GetSimContext().GetScriptInterface());
@ -63,7 +63,7 @@ public:
}
}
virtual void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize)
void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) override
{
ScriptRequest rq(GetSimContext().GetScriptInterface());
@ -79,13 +79,13 @@ public:
}
}
virtual void PushLocalCommand(player_id_t player, JS::HandleValue cmd)
void PushLocalCommand(player_id_t player, JS::HandleValue cmd) override
{
ScriptRequest rq(GetSimContext().GetScriptInterface());
m_LocalQueue.emplace_back(SimulationCommand(player, rq.cx, cmd));
}
virtual void PostNetworkCommand(JS::HandleValue cmd1)
void PostNetworkCommand(JS::HandleValue cmd1) override
{
ScriptRequest rq(GetSimContext().GetScriptInterface());
@ -100,7 +100,7 @@ public:
g_Game->GetTurnManager()->PostCommand(cmd);
}
virtual void FlushTurn(const std::vector<SimulationCommand>& commands)
void FlushTurn(const std::vector<SimulationCommand>& commands) override
{
const ScriptInterface& scriptInterface = GetSimContext().GetScriptInterface();
ScriptRequest rq(scriptInterface);

View File

@ -89,7 +89,7 @@ public:
"</element>";
}
virtual void Init(const CParamNode& paramNode)
void Init(const CParamNode& paramNode) override
{
m_Active = paramNode.GetChild("Active").ToBool();
m_ShipSink = paramNode.GetChild("SinkingAnim").ToBool();
@ -111,21 +111,21 @@ public:
GetSimContext().GetComponentManager().DynamicSubscriptionNonsync(MT_Interpolate, this, true);
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& UNUSED(serialize))
void Serialize(ISerializer& UNUSED(serialize)) override
{
// This component isn't network-synchronised, so don't serialize anything
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize))
void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override
{
Init(paramNode);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{

View File

@ -92,7 +92,7 @@ public:
"</optional>";
}
virtual void Init(const CParamNode& paramNode)
void Init(const CParamNode& paramNode) override
{
if (paramNode.GetChild("Square").IsOk())
{
@ -121,21 +121,21 @@ public:
m_MaxSpawnDistance = entity_pos_t::FromInt(7);
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& UNUSED(serialize))
void Serialize(ISerializer& UNUSED(serialize)) override
{
// No dynamic state to serialize
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize))
void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override
{
Init(paramNode);
}
virtual void GetShape(EShape& shape, entity_pos_t& size0, entity_pos_t& size1, entity_pos_t& height) const
void GetShape(EShape& shape, entity_pos_t& size0, entity_pos_t& size1, entity_pos_t& height) const override
{
shape = m_Shape;
size0 = m_Size0;
@ -143,7 +143,7 @@ public:
height = m_Height;
}
virtual CFixedVector3D PickSpawnPoint(entity_id_t spawned) const
CFixedVector3D PickSpawnPoint(entity_id_t spawned) const override
{
PROFILE3("PickSpawnPoint");
@ -269,7 +269,7 @@ public:
return error;
}
virtual CFixedVector3D PickSpawnPointBothPass(entity_id_t spawned) const
CFixedVector3D PickSpawnPointBothPass(entity_id_t spawned) const override
{
PROFILE3("PickSpawnPointBothPass");

View File

@ -99,7 +99,7 @@ public:
"</optional>";
}
virtual void Init(const CParamNode& paramNode)
void Init(const CParamNode& paramNode) override
{
m_Active = true;
m_IsPinging = false;
@ -136,7 +136,7 @@ public:
}
}
virtual void Deinit()
void Deinit() override
{
}
@ -152,19 +152,19 @@ public:
}
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
SerializeCommon(serialize);
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize)
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override
{
Init(paramNode);
SerializeCommon(deserialize);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -207,7 +207,7 @@ public:
}
}
virtual bool GetRenderData(u8& r, u8& g, u8& b, entity_pos_t& x, entity_pos_t& z) const
bool GetRenderData(u8& r, u8& g, u8& b, entity_pos_t& x, entity_pos_t& z) const override
{
if (!m_Active)
return false;
@ -220,7 +220,7 @@ public:
return true;
}
virtual bool CheckPing(double currentTime, double pingDuration)
bool CheckPing(double currentTime, double pingDuration) override
{
if (!m_Active || !m_IsPinging)
return false;
@ -237,7 +237,7 @@ public:
return m_IsPinging;
}
virtual void UpdateColor()
void UpdateColor() override
{
if (!m_UsePlayerColor)
return;

View File

@ -43,30 +43,30 @@ public:
return "<a:component type='test'/><ref name='anything'/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
m_SpeedX = 0;
m_SpeedZ = 0;
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
serialize.NumberFloat_Unbounded("speed x", m_SpeedX);
serialize.NumberFloat_Unbounded("speed z", m_SpeedZ);
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize)
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override
{
Init(paramNode);
deserialize.NumberFloat_Unbounded("speed x", m_SpeedX);
deserialize.NumberFloat_Unbounded("speed z", m_SpeedZ);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{

View File

@ -196,7 +196,7 @@ public:
"</optional>";
}
virtual void Init(const CParamNode& paramNode)
void Init(const CParamNode& paramNode) override
{
// The minimum obstruction size is the navcell size * sqrt(2)
// This is enforced in the schema as a minimum of 1.5
@ -273,7 +273,7 @@ public:
m_ControlGroup2 = INVALID_ENTITY;
}
virtual void Deinit()
void Deinit() override
{
}
@ -292,19 +292,19 @@ public:
serialize.NumberFixed_Unbounded("clearance", m_Clearance);
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
SerializeCommon(serialize);
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize)
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override
{
Init(paramNode);
SerializeCommon(deserialize);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -380,7 +380,7 @@ public:
}
}
virtual void SetActive(bool active)
void SetActive(bool active) override
{
if (active && !m_Active && !m_IsDestroyed)
{
@ -446,7 +446,7 @@ public:
// else we didn't change the active status
}
virtual void SetDisableBlockMovementPathfinding(bool movementDisabled, bool pathfindingDisabled, int32_t shape)
void SetDisableBlockMovementPathfinding(bool movementDisabled, bool pathfindingDisabled, int32_t shape) override
{
flags_t *flags = NULL;
if (shape == -1)
@ -476,27 +476,27 @@ public:
}
}
virtual bool GetBlockMovementFlag(bool templateOnly) const
bool GetBlockMovementFlag(bool templateOnly) const override
{
return m_Active && ((templateOnly ? m_TemplateFlags : m_Flags) & ICmpObstructionManager::FLAG_BLOCK_MOVEMENT) != 0;
}
virtual EObstructionType GetObstructionType() const
EObstructionType GetObstructionType() const override
{
return m_Type;
}
virtual ICmpObstructionManager::tag_t GetObstruction() const
ICmpObstructionManager::tag_t GetObstruction() const override
{
return m_Tag;
}
virtual bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const
bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const override
{
return GetObstructionSquare(out, true);
}
virtual bool GetObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const
bool GetObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const override
{
return GetObstructionSquare(out, false);
}
@ -526,7 +526,7 @@ public:
return true;
}
virtual entity_pos_t GetSize() const
entity_pos_t GetSize() const override
{
if (m_Type == UNIT)
return m_Clearance;
@ -534,12 +534,12 @@ public:
return CFixedVector2D(m_Size0 / 2, m_Size1 / 2).Length();
}
virtual CFixedVector2D GetStaticSize() const
CFixedVector2D GetStaticSize() const override
{
return m_Type == STATIC ? CFixedVector2D(m_Size0, m_Size1) : CFixedVector2D();
}
virtual void SetUnitClearance(const entity_pos_t& clearance)
void SetUnitClearance(const entity_pos_t& clearance) override
{
// This doesn't send a MovementObstructionChanged message
// because it's a just a workaround init order, and used in UnitMotion directly.
@ -547,12 +547,12 @@ public:
m_Clearance = clearance;
}
virtual bool IsControlPersistent() const
bool IsControlPersistent() const override
{
return m_ControlPersist;
}
virtual bool CheckShorePlacement() const
bool CheckShorePlacement() const override
{
ICmpObstructionManager::ObstructionSquare s;
if (!GetObstructionSquare(s))
@ -571,12 +571,12 @@ public:
cmpWaterManager->GetWaterLevel( back.X, back.Y) - cmpTerrain->GetGroundLevel( back.X, back.Y) < fixed::FromInt(2);
}
virtual EFoundationCheck CheckFoundation(const std::string& className) const
EFoundationCheck CheckFoundation(const std::string& className) const override
{
return CheckFoundation(className, false);
}
virtual EFoundationCheck CheckFoundation(const std::string& className, bool onlyCenterPoint) const
EFoundationCheck CheckFoundation(const std::string& className, bool onlyCenterPoint) const override
{
CmpPtr<ICmpPosition> cmpPosition(GetEntityHandle());
if (!cmpPosition)
@ -613,7 +613,7 @@ public:
return cmpPathfinder->CheckBuildingPlacement(filter, pos.X, pos.Y, cmpPosition->GetRotation().Y, m_Size0, m_Size1, GetEntityId(), passClass, onlyCenterPoint);
}
virtual bool CheckDuplicateFoundation() const
bool CheckDuplicateFoundation() const override
{
CmpPtr<ICmpPosition> cmpPosition(GetEntityHandle());
if (!cmpPosition)
@ -645,7 +645,7 @@ public:
return !cmpObstructionManager->TestStaticShape(filter, pos.X, pos.Y, cmpPosition->GetRotation().Y, m_Size0, m_Size1, NULL );
}
virtual std::vector<entity_id_t> GetEntitiesByFlags(flags_t flags) const
std::vector<entity_id_t> GetEntitiesByFlags(flags_t flags) const override
{
std::vector<entity_id_t> ret;
@ -668,22 +668,22 @@ public:
return ret;
}
virtual std::vector<entity_id_t> GetEntitiesBlockingMovement() const
std::vector<entity_id_t> GetEntitiesBlockingMovement() const override
{
return GetEntitiesByFlags(ICmpObstructionManager::FLAG_BLOCK_MOVEMENT);
}
virtual std::vector<entity_id_t> GetEntitiesBlockingConstruction() const
std::vector<entity_id_t> GetEntitiesBlockingConstruction() const override
{
return GetEntitiesByFlags(ICmpObstructionManager::FLAG_BLOCK_CONSTRUCTION);
}
virtual std::vector<entity_id_t> GetEntitiesDeletedUponConstruction() const
std::vector<entity_id_t> GetEntitiesDeletedUponConstruction() const override
{
return GetEntitiesByFlags(ICmpObstructionManager::FLAG_DELETE_UPON_CONSTRUCTION);
}
virtual void SetMovingFlag(bool enabled)
void SetMovingFlag(bool enabled) override
{
m_Moving = enabled;
@ -695,24 +695,24 @@ public:
}
}
virtual void SetControlGroup(entity_id_t group)
void SetControlGroup(entity_id_t group) override
{
m_ControlGroup = group;
UpdateControlGroups();
}
virtual void SetControlGroup2(entity_id_t group2)
void SetControlGroup2(entity_id_t group2) override
{
m_ControlGroup2 = group2;
UpdateControlGroups();
}
virtual entity_id_t GetControlGroup() const
entity_id_t GetControlGroup() const override
{
return m_ControlGroup;
}
virtual entity_id_t GetControlGroup2() const
entity_id_t GetControlGroup2() const override
{
return m_ControlGroup2;
}
@ -744,7 +744,7 @@ public:
}
}
void ResolveFoundationCollisions() const
void ResolveFoundationCollisions() const override
{
if (m_Type == UNIT)
return;

View File

@ -160,7 +160,7 @@ public:
return "<a:component type='system'/><empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
m_DebugOverlayEnabled = false;
m_DebugOverlayDirty = true;
@ -180,7 +180,7 @@ public:
ResetSubdivisions(entity_pos_t::FromInt(1024), entity_pos_t::FromInt(1024));
}
virtual void Deinit()
void Deinit() override
{
}
@ -205,7 +205,7 @@ public:
serialize.NumberFixed_Unbounded("world z1", m_WorldZ1);
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
// TODO: this could perhaps be optimised by not storing all the obstructions,
// and instead regenerating them from the other entities on Deserialize
@ -213,7 +213,7 @@ public:
SerializeCommon(serialize);
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize)
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override
{
Init(paramNode);
@ -223,7 +223,7 @@ public:
m_UpdateInformations.dirtinessGrid = Grid<u8>(size, size);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -238,7 +238,7 @@ public:
// NB: on deserialization, this function is not called after the component is reset.
// So anything that happens here should be safely serialized.
virtual void SetBounds(entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1)
void SetBounds(entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1) override
{
m_WorldX0 = x0;
m_WorldZ0 = z0;
@ -278,7 +278,7 @@ public:
}
}
virtual tag_t AddUnitShape(entity_id_t ent, entity_pos_t x, entity_pos_t z, entity_pos_t clearance, flags_t flags, entity_id_t group)
tag_t AddUnitShape(entity_id_t ent, entity_pos_t x, entity_pos_t z, entity_pos_t clearance, flags_t flags, entity_id_t group) override
{
UnitShape shape = { ent, x, z, clearance, flags, group };
u32 id = m_UnitShapeNext++;
@ -291,7 +291,7 @@ public:
return UNIT_INDEX_TO_TAG(id);
}
virtual tag_t AddStaticShape(entity_id_t ent, entity_pos_t x, entity_pos_t z, entity_angle_t a, entity_pos_t w, entity_pos_t h, flags_t flags, entity_id_t group, entity_id_t group2 /* = INVALID_ENTITY */)
tag_t AddStaticShape(entity_id_t ent, entity_pos_t x, entity_pos_t z, entity_angle_t a, entity_pos_t w, entity_pos_t h, flags_t flags, entity_id_t group, entity_id_t group2 /* = INVALID_ENTITY */) override
{
fixed s, c;
sincos_approx(a, s, c);
@ -311,7 +311,7 @@ public:
return STATIC_INDEX_TO_TAG(id);
}
virtual ObstructionSquare GetUnitShapeObstruction(entity_pos_t x, entity_pos_t z, entity_pos_t clearance) const
ObstructionSquare GetUnitShapeObstruction(entity_pos_t x, entity_pos_t z, entity_pos_t clearance) const override
{
CFixedVector2D u(entity_pos_t::FromInt(1), entity_pos_t::Zero());
CFixedVector2D v(entity_pos_t::Zero(), entity_pos_t::FromInt(1));
@ -319,7 +319,7 @@ public:
return o;
}
virtual ObstructionSquare GetStaticShapeObstruction(entity_pos_t x, entity_pos_t z, entity_angle_t a, entity_pos_t w, entity_pos_t h) const
ObstructionSquare GetStaticShapeObstruction(entity_pos_t x, entity_pos_t z, entity_angle_t a, entity_pos_t w, entity_pos_t h) const override
{
fixed s, c;
sincos_approx(a, s, c);
@ -330,7 +330,7 @@ public:
return o;
}
virtual void MoveShape(tag_t tag, entity_pos_t x, entity_pos_t z, entity_angle_t a)
void MoveShape(tag_t tag, entity_pos_t x, entity_pos_t z, entity_angle_t a) override
{
ENSURE(TAG_IS_VALID(tag));
@ -379,7 +379,7 @@ public:
}
}
virtual void SetUnitMovingFlag(tag_t tag, bool moving)
void SetUnitMovingFlag(tag_t tag, bool moving) override
{
ENSURE(TAG_IS_VALID(tag) && TAG_IS_UNIT(tag));
@ -395,7 +395,7 @@ public:
}
}
virtual void SetUnitControlGroup(tag_t tag, entity_id_t group)
void SetUnitControlGroup(tag_t tag, entity_id_t group) override
{
ENSURE(TAG_IS_VALID(tag) && TAG_IS_UNIT(tag));
@ -406,7 +406,7 @@ public:
}
}
virtual void SetStaticControlGroup(tag_t tag, entity_id_t group, entity_id_t group2)
void SetStaticControlGroup(tag_t tag, entity_id_t group, entity_id_t group2) override
{
ENSURE(TAG_IS_VALID(tag) && TAG_IS_STATIC(tag));
@ -418,7 +418,7 @@ public:
}
}
virtual void RemoveShape(tag_t tag)
void RemoveShape(tag_t tag) override
{
ENSURE(TAG_IS_VALID(tag));
@ -447,7 +447,7 @@ public:
}
}
virtual ObstructionSquare GetObstruction(tag_t tag) const
ObstructionSquare GetObstruction(tag_t tag) const override
{
ENSURE(TAG_IS_VALID(tag));
@ -467,31 +467,31 @@ public:
}
}
virtual fixed DistanceToPoint(entity_id_t ent, entity_pos_t px, entity_pos_t pz) const;
virtual fixed MaxDistanceToPoint(entity_id_t ent, entity_pos_t px, entity_pos_t pz) const;
virtual fixed DistanceToTarget(entity_id_t ent, entity_id_t target) const;
virtual fixed MaxDistanceToTarget(entity_id_t ent, entity_id_t target) const;
virtual fixed DistanceBetweenShapes(const ObstructionSquare& source, const ObstructionSquare& target) const;
virtual fixed MaxDistanceBetweenShapes(const ObstructionSquare& source, const ObstructionSquare& target) const;
fixed DistanceToPoint(entity_id_t ent, entity_pos_t px, entity_pos_t pz) const override;
fixed MaxDistanceToPoint(entity_id_t ent, entity_pos_t px, entity_pos_t pz) const override;
fixed DistanceToTarget(entity_id_t ent, entity_id_t target) const override;
fixed MaxDistanceToTarget(entity_id_t ent, entity_id_t target) const override;
fixed DistanceBetweenShapes(const ObstructionSquare& source, const ObstructionSquare& target) const override;
fixed MaxDistanceBetweenShapes(const ObstructionSquare& source, const ObstructionSquare& target) const override;
virtual bool IsInPointRange(entity_id_t ent, entity_pos_t px, entity_pos_t pz, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const;
virtual bool IsInTargetRange(entity_id_t ent, entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const;
virtual bool IsInTargetParabolicRange(entity_id_t ent, entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange, entity_pos_t yOrigin, bool opposite) const;
virtual bool IsPointInPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t px, entity_pos_t pz, entity_pos_t minRange, entity_pos_t maxRange) const;
virtual bool AreShapesInRange(const ObstructionSquare& source, const ObstructionSquare& target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const;
bool IsInPointRange(entity_id_t ent, entity_pos_t px, entity_pos_t pz, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const override;
bool IsInTargetRange(entity_id_t ent, entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const override;
bool IsInTargetParabolicRange(entity_id_t ent, entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange, entity_pos_t yOrigin, bool opposite) const override;
bool IsPointInPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t px, entity_pos_t pz, entity_pos_t minRange, entity_pos_t maxRange) const override;
bool AreShapesInRange(const ObstructionSquare& source, const ObstructionSquare& target, entity_pos_t minRange, entity_pos_t maxRange, bool opposite) const override;
virtual bool TestLine(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, bool relaxClearanceForUnits = false) const;
virtual bool TestStaticShape(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, std::vector<entity_id_t>* out) const;
virtual bool TestUnitShape(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, std::vector<entity_id_t>* out) const;
bool TestLine(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, bool relaxClearanceForUnits = false) const override;
bool TestStaticShape(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, std::vector<entity_id_t>* out) const override;
bool TestUnitShape(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, std::vector<entity_id_t>* out) const override;
virtual void Rasterize(Grid<NavcellData>& grid, const std::vector<PathfinderPassability>& passClasses, bool fullUpdate);
virtual void GetObstructionsInRange(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, std::vector<ObstructionSquare>& squares) const;
virtual void GetUnitObstructionsInRange(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, std::vector<ObstructionSquare>& squares) const;
virtual void GetStaticObstructionsInRange(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, std::vector<ObstructionSquare>& squares) const;
virtual void GetUnitsOnObstruction(const ObstructionSquare& square, std::vector<entity_id_t>& out, const IObstructionTestFilter& filter, bool strict = false) const;
virtual void GetStaticObstructionsOnObstruction(const ObstructionSquare& square, std::vector<entity_id_t>& out, const IObstructionTestFilter& filter) const;
void Rasterize(Grid<NavcellData>& grid, const std::vector<PathfinderPassability>& passClasses, bool fullUpdate) override;
void GetObstructionsInRange(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, std::vector<ObstructionSquare>& squares) const override;
void GetUnitObstructionsInRange(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, std::vector<ObstructionSquare>& squares) const override;
void GetStaticObstructionsInRange(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, std::vector<ObstructionSquare>& squares) const override;
void GetUnitsOnObstruction(const ObstructionSquare& square, std::vector<entity_id_t>& out, const IObstructionTestFilter& filter, bool strict = false) const override;
void GetStaticObstructionsOnObstruction(const ObstructionSquare& square, std::vector<entity_id_t>& out, const IObstructionTestFilter& filter) const override;
virtual void SetPassabilityCircular(bool enabled)
void SetPassabilityCircular(bool enabled) override
{
m_PassabilityCircular = enabled;
MakeDirtyAll();
@ -500,12 +500,12 @@ public:
GetSimContext().GetComponentManager().BroadcastMessage(msg);
}
virtual bool GetPassabilityCircular() const
bool GetPassabilityCircular() const override
{
return m_PassabilityCircular;
}
virtual void SetDebugOverlay(bool enabled)
void SetDebugOverlay(bool enabled) override
{
m_DebugOverlayEnabled = enabled;
m_DebugOverlayDirty = true;
@ -515,7 +515,7 @@ public:
void RenderSubmit(SceneCollector& collector);
virtual void UpdateInformations(GridUpdateInformation& informations)
void UpdateInformations(GridUpdateInformation& informations) override
{
if (!m_UpdateInformations.dirtinessGrid.blank())
informations.MergeAndClear(m_UpdateInformations);

View File

@ -54,27 +54,27 @@ public:
return "<empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& UNUSED(serialize))
void Serialize(ISerializer& UNUSED(serialize)) override
{
// TODO: should we do anything here?
// or should we expect other components to reinitialise us
// after deserialization?
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize))
void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override
{
Init(paramNode);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -107,7 +107,7 @@ public:
GetSimContext().GetComponentManager().DynamicSubscriptionNonsync(MT_RenderSubmit, this, needRender);
}
virtual void Reset()
void Reset() override
{
m_Sprites.clear();
m_SpriteOffsets.clear();
@ -115,7 +115,7 @@ public:
UpdateMessageSubscriptions();
}
virtual void AddSprite(const VfsPath& textureName, const CFixedVector2D& corner0, const CFixedVector2D& corner1, const CFixedVector3D& position, const std::string& color)
void AddSprite(const VfsPath& textureName, const CFixedVector2D& corner0, const CFixedVector2D& corner1, const CFixedVector3D& position, const std::string& color) override
{
CColor colorObj(1.0f, 1.0f, 1.0f, 1.0f);
if (!colorObj.ParseString(color, 1))

View File

@ -45,26 +45,26 @@ public:
"<empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
m_Owner = INVALID_PLAYER;
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
serialize.NumberI32_Unbounded("owner", m_Owner);
}
virtual void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize)
void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) override
{
deserialize.NumberI32_Unbounded("owner", m_Owner);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -77,12 +77,12 @@ public:
}
}
virtual player_id_t GetOwner() const
player_id_t GetOwner() const override
{
return m_Owner;
}
virtual void SetOwner(player_id_t playerID)
void SetOwner(player_id_t playerID) override
{
if (playerID == m_Owner)
return;
@ -94,7 +94,7 @@ public:
GetSimContext().GetComponentManager().PostMessage(GetEntityId(), msg);
}
virtual void SetOwnerQuiet(player_id_t playerID)
void SetOwnerQuiet(player_id_t playerID) override
{
if (playerID != m_Owner)
m_Owner = playerID;

View File

@ -42,25 +42,25 @@ public:
return "<a:component type='system'/><empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
useSimTime = true;
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& UNUSED(serialize))
void Serialize(ISerializer& UNUSED(serialize)) override
{
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize))
void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override
{
Init(paramNode);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -77,7 +77,7 @@ public:
}
}
virtual void SetUseSimTime(bool flag)
void SetUseSimTime(bool flag) override
{
useSimTime = flag;
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -149,29 +149,29 @@ public:
return "<a:component type='system'/><empty/>";
}
virtual void Init(const CParamNode& paramNode);
void Init(const CParamNode& paramNode) override;
virtual void Deinit();
void Deinit() override;
template<typename S>
void SerializeCommon(S& serialize);
virtual void Serialize(ISerializer& serialize);
void Serialize(ISerializer& serialize) override;
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize);
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override;
virtual void HandleMessage(const CMessage& msg, bool global);
void HandleMessage(const CMessage& msg, bool global) override;
virtual pass_class_t GetPassabilityClass(const std::string& name) const;
pass_class_t GetPassabilityClass(const std::string& name) const override;
virtual void GetPassabilityClasses(std::map<std::string, pass_class_t>& passClasses) const;
virtual void GetPassabilityClasses(
void GetPassabilityClasses(std::map<std::string, pass_class_t>& passClasses) const override;
void GetPassabilityClasses(
std::map<std::string, pass_class_t>& nonPathfindingPassClasses,
std::map<std::string, pass_class_t>& pathfindingPassClasses) const;
std::map<std::string, pass_class_t>& pathfindingPassClasses) const override;
const PathfinderPassability* GetPassabilityFromMask(pass_class_t passClass) const;
virtual entity_pos_t GetClearance(pass_class_t passClass) const
entity_pos_t GetClearance(pass_class_t passClass) const override
{
const PathfinderPassability* passability = GetPassabilityFromMask(passClass);
if (!passability)
@ -180,7 +180,7 @@ public:
return passability->m_Clearance;
}
virtual entity_pos_t GetMaximumClearance() const
entity_pos_t GetMaximumClearance() const override
{
entity_pos_t max = fixed::Zero();
@ -191,51 +191,51 @@ public:
return max + Pathfinding::CLEARANCE_EXTENSION_RADIUS;
}
virtual const Grid<NavcellData>& GetPassabilityGrid();
const Grid<NavcellData>& GetPassabilityGrid() override;
virtual const GridUpdateInformation& GetAIPathfinderDirtinessInformation() const
const GridUpdateInformation& GetAIPathfinderDirtinessInformation() const override
{
return m_AIPathfinderDirtinessInformation;
}
virtual void FlushAIPathfinderDirtinessInformation()
void FlushAIPathfinderDirtinessInformation() override
{
m_AIPathfinderDirtinessInformation.Clean();
}
virtual Grid<u16> ComputeShoreGrid(bool expandOnWater = false);
Grid<u16> ComputeShoreGrid(bool expandOnWater = false) override;
virtual void ComputePathImmediate(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass, WaypointPath& ret) const;
void ComputePathImmediate(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass, WaypointPath& ret) const override;
virtual u32 ComputePathAsync(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass, entity_id_t notify);
u32 ComputePathAsync(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass, entity_id_t notify) override;
virtual WaypointPath ComputeShortPathImmediate(const ShortPathRequest& request) const;
WaypointPath ComputeShortPathImmediate(const ShortPathRequest& request) const override;
virtual u32 ComputeShortPathAsync(entity_pos_t x0, entity_pos_t z0, entity_pos_t clearance, entity_pos_t range, const PathGoal& goal, pass_class_t passClass, bool avoidMovingUnits, entity_id_t controller, entity_id_t notify);
u32 ComputeShortPathAsync(entity_pos_t x0, entity_pos_t z0, entity_pos_t clearance, entity_pos_t range, const PathGoal& goal, pass_class_t passClass, bool avoidMovingUnits, entity_id_t controller, entity_id_t notify) override;
virtual bool IsGoalReachable(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass);
bool IsGoalReachable(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass) override;
virtual void SetDebugPath(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass);
void SetDebugPath(entity_pos_t x0, entity_pos_t z0, const PathGoal& goal, pass_class_t passClass) override;
virtual void SetDebugOverlay(bool enabled);
void SetDebugOverlay(bool enabled) override;
virtual void SetHierDebugOverlay(bool enabled);
void SetHierDebugOverlay(bool enabled) override;
virtual void GetDebugData(u32& steps, double& time, Grid<u8>& grid) const;
void GetDebugData(u32& steps, double& time, Grid<u8>& grid) const override;
virtual void SetAtlasOverlay(bool enable, pass_class_t passClass = 0);
void SetAtlasOverlay(bool enable, pass_class_t passClass = 0) override;
virtual bool CheckMovement(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, pass_class_t passClass) const;
bool CheckMovement(const IObstructionTestFilter& filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, pass_class_t passClass) const override;
virtual ICmpObstruction::EFoundationCheck CheckUnitPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, pass_class_t passClass, bool onlyCenterPoint) const;
ICmpObstruction::EFoundationCheck CheckUnitPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, pass_class_t passClass, bool onlyCenterPoint) const override;
virtual ICmpObstruction::EFoundationCheck CheckBuildingPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass) const;
ICmpObstruction::EFoundationCheck CheckBuildingPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass) const override;
virtual ICmpObstruction::EFoundationCheck CheckBuildingPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass, bool onlyCenterPoint) const;
ICmpObstruction::EFoundationCheck CheckBuildingPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass, bool onlyCenterPoint) const override;
virtual void SendRequestedPaths();
void SendRequestedPaths() override;
virtual void StartProcessingMoves(bool useMax);
void StartProcessingMoves(bool useMax) override;
template <typename T>
std::vector<T> GetMovesToProcess(std::vector<T>& requests, bool useMax = false, size_t maxMoves = 0);
@ -246,7 +246,7 @@ public:
/**
* Regenerates the grid based on the current obstruction list, if necessary
*/
virtual void UpdateGrid();
void UpdateGrid() override;
/**
* Updates the terrain-only grid without updating the dirtiness informations.
@ -274,7 +274,7 @@ public:
{
}
virtual void BuildTextureRGBA(u8* data, size_t w, size_t h)
void BuildTextureRGBA(u8* data, size_t w, size_t h) override
{
// Render navcell passability, based on the terrain-only grid
u8* p = data;

View File

@ -136,7 +136,7 @@ public:
"</element>";
}
virtual void Init(const CParamNode& paramNode)
void Init(const CParamNode& paramNode) override
{
const std::string& anchor = paramNode.GetChild("Anchor").ToString();
if (anchor == "pitch")
@ -171,11 +171,11 @@ public:
m_EnabledMessageInterpolate = false;
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
serialize.Bool("in world", m_InWorld);
if (m_InWorld)
@ -232,7 +232,7 @@ public:
Serializer(serialize, "turrets", m_Turrets);
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize)
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override
{
Init(paramNode);
@ -280,7 +280,7 @@ public:
AdvertiseInterpolatedPositionChanges();
}
virtual void UpdateTurretPosition()
void UpdateTurretPosition() override
{
if (m_TurretParent == INVALID_ENTITY)
return;
@ -308,12 +308,12 @@ public:
}
}
virtual std::set<entity_id_t>* GetTurrets()
std::set<entity_id_t>* GetTurrets() override
{
return &m_Turrets;
}
virtual void SetTurretParent(entity_id_t id, const CFixedVector3D& offset)
void SetTurretParent(entity_id_t id, const CFixedVector3D& offset) override
{
entity_angle_t angle = GetRotation().Y;
if (m_TurretParent != INVALID_ENTITY)
@ -336,17 +336,17 @@ public:
UpdateTurretPosition();
}
virtual entity_id_t GetTurretParent() const
entity_id_t GetTurretParent() const override
{
return m_TurretParent;
}
virtual bool IsInWorld() const
bool IsInWorld() const override
{
return m_InWorld;
}
virtual void MoveOutOfWorld()
void MoveOutOfWorld() override
{
m_InWorld = false;
@ -354,7 +354,7 @@ public:
AdvertiseInterpolatedPositionChanges();
}
virtual void MoveTo(entity_pos_t x, entity_pos_t z)
void MoveTo(entity_pos_t x, entity_pos_t z) override
{
m_X = x;
m_Z = z;
@ -371,7 +371,7 @@ public:
AdvertiseInterpolatedPositionChanges();
}
virtual void MoveAndTurnTo(entity_pos_t x, entity_pos_t z, entity_angle_t ry)
void MoveAndTurnTo(entity_pos_t x, entity_pos_t z, entity_angle_t ry) override
{
m_X = x;
m_Z = z;
@ -390,7 +390,7 @@ public:
AdvertiseInterpolatedPositionChanges();
}
virtual void JumpTo(entity_pos_t x, entity_pos_t z)
void JumpTo(entity_pos_t x, entity_pos_t z) override
{
m_LastX = m_PrevX = m_X = x;
m_LastZ = m_PrevZ = m_Z = z;
@ -405,7 +405,7 @@ public:
AdvertiseInterpolatedPositionChanges();
}
virtual void SetHeightOffset(entity_pos_t dy)
void SetHeightOffset(entity_pos_t dy) override
{
// subtract the offset and replace with a new offset
m_LastYDifference = dy - GetHeightOffset();
@ -413,7 +413,7 @@ public:
AdvertiseInterpolatedPositionChanges();
}
virtual entity_pos_t GetHeightOffset() const
entity_pos_t GetHeightOffset() const override
{
if (m_RelativeToGround)
return m_Y;
@ -433,7 +433,7 @@ public:
return m_Y - baseY;
}
virtual void SetHeightFixed(entity_pos_t y)
void SetHeightFixed(entity_pos_t y) override
{
// subtract the absolute height and replace it with a new absolute height
m_LastYDifference = y - GetHeightFixed();
@ -441,12 +441,12 @@ public:
AdvertiseInterpolatedPositionChanges();
}
virtual entity_pos_t GetHeightFixed() const
entity_pos_t GetHeightFixed() const override
{
return GetHeightAtFixed(m_X, m_Z);
}
virtual entity_pos_t GetHeightAtFixed(entity_pos_t x, entity_pos_t z) const
entity_pos_t GetHeightAtFixed(entity_pos_t x, entity_pos_t z) const override
{
if (!m_RelativeToGround)
return m_Y;
@ -466,12 +466,12 @@ public:
return m_Y + baseY;
}
virtual bool IsHeightRelative() const
bool IsHeightRelative() const override
{
return m_RelativeToGround;
}
virtual void SetHeightRelative(bool relative)
void SetHeightRelative(bool relative) override
{
// move y to use the right offset (from terrain or from map origin)
m_Y = relative ? GetHeightOffset() : GetHeightFixed();
@ -480,30 +480,30 @@ public:
AdvertiseInterpolatedPositionChanges();
}
virtual bool CanFloat() const
bool CanFloat() const override
{
return m_Floating;
}
virtual void SetFloating(bool flag)
void SetFloating(bool flag) override
{
m_Floating = flag;
AdvertiseInterpolatedPositionChanges();
}
virtual void SetActorFloating(bool flag)
void SetActorFloating(bool flag) override
{
m_ActorFloating = flag;
AdvertiseInterpolatedPositionChanges();
}
virtual void SetConstructionProgress(fixed progress)
void SetConstructionProgress(fixed progress) override
{
m_ConstructionProgress = progress;
AdvertiseInterpolatedPositionChanges();
}
virtual CFixedVector3D GetPosition() const
CFixedVector3D GetPosition() const override
{
if (!m_InWorld)
{
@ -514,7 +514,7 @@ public:
return CFixedVector3D(m_X, GetHeightFixed(), m_Z);
}
virtual CFixedVector2D GetPosition2D() const
CFixedVector2D GetPosition2D() const override
{
if (!m_InWorld)
{
@ -525,7 +525,7 @@ public:
return CFixedVector2D(m_X, m_Z);
}
virtual CFixedVector3D GetPreviousPosition() const
CFixedVector3D GetPreviousPosition() const override
{
if (!m_InWorld)
{
@ -536,7 +536,7 @@ public:
return CFixedVector3D(m_PrevX, GetHeightAtFixed(m_PrevX, m_PrevZ), m_PrevZ);
}
virtual CFixedVector2D GetPreviousPosition2D() const
CFixedVector2D GetPreviousPosition2D() const override
{
if (!m_InWorld)
{
@ -547,12 +547,12 @@ public:
return CFixedVector2D(m_PrevX, m_PrevZ);
}
virtual fixed GetTurnRate() const
fixed GetTurnRate() const override
{
return m_RotYSpeed;
}
virtual void TurnTo(entity_angle_t y)
void TurnTo(entity_angle_t y) override
{
if (m_TurretParent != INVALID_ENTITY)
{
@ -566,7 +566,7 @@ public:
UpdateMessageSubscriptions();
}
virtual void SetYRotation(entity_angle_t y)
void SetYRotation(entity_angle_t y) override
{
if (m_TurretParent != INVALID_ENTITY)
{
@ -589,7 +589,7 @@ public:
UpdateMessageSubscriptions();
}
virtual void SetXZRotation(entity_angle_t x, entity_angle_t z)
void SetXZRotation(entity_angle_t x, entity_angle_t z) override
{
m_RotX = x;
m_RotZ = z;
@ -603,7 +603,7 @@ public:
}
}
virtual CFixedVector3D GetRotation() const
CFixedVector3D GetRotation() const override
{
entity_angle_t y = m_RotY;
if (m_TurretParent != INVALID_ENTITY)
@ -615,7 +615,7 @@ public:
return CFixedVector3D(m_RotX, y, m_RotZ);
}
virtual fixed GetDistanceTravelled() const
fixed GetDistanceTravelled() const override
{
if (!m_InWorld)
{
@ -656,7 +656,7 @@ public:
return (m_ConstructionProgress.ToFloat() - 1.0f) * dy;
}
virtual void GetInterpolatedPosition2D(float frameOffset, float& x, float& z, float& rotY) const
void GetInterpolatedPosition2D(float frameOffset, float& x, float& z, float& rotY) const override
{
if (!m_InWorld)
{
@ -670,7 +670,7 @@ public:
rotY = m_InterpolatedRotY;
}
virtual CMatrix3D GetInterpolatedTransform(float frameOffset) const
CMatrix3D GetInterpolatedTransform(float frameOffset) const override
{
if (m_TurretParent != INVALID_ENTITY)
{
@ -782,7 +782,7 @@ public:
pos1.Y += GetConstructionProgressOffset(pos1);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{

View File

@ -57,20 +57,20 @@ public:
return "<a:component type='system'/><empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
m_ActorSeed = 0;
m_NextId = 1;
}
virtual void Deinit()
void Deinit() override
{
for (size_t i = 0; i < m_Projectiles.size(); ++i)
GetSimContext().GetUnitManager().DeleteUnit(m_Projectiles[i].unit);
m_Projectiles.clear();
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
// Because this is just graphical effects, and because it's all non-deterministic floating point,
// we don't do much serialization here.
@ -80,7 +80,7 @@ public:
serialize.NumberU32_Unbounded("next id", m_NextId);
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize)
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override
{
Init(paramNode);
@ -88,7 +88,7 @@ public:
deserialize.NumberU32_Unbounded("next id", m_NextId);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -107,12 +107,12 @@ public:
}
}
virtual uint32_t LaunchProjectileAtPoint(const CFixedVector3D& launchPoint, const CFixedVector3D& target, fixed speed, fixed gravity, const std::wstring& actorName, const std::wstring& impactActorName, fixed impactAnimationLifetime)
uint32_t LaunchProjectileAtPoint(const CFixedVector3D& launchPoint, const CFixedVector3D& target, fixed speed, fixed gravity, const std::wstring& actorName, const std::wstring& impactActorName, fixed impactAnimationLifetime) override
{
return LaunchProjectile(launchPoint, target, speed, gravity, actorName, impactActorName, impactAnimationLifetime);
}
virtual void RemoveProjectile(uint32_t);
void RemoveProjectile(uint32_t) override;
void RenderModel(CModelAbstract& model, const CVector3D& position, SceneCollector& collector, const CFrustum& frustum, bool culling,
const CLosQuerier& los, bool losRevealAll) const;

View File

@ -72,13 +72,13 @@ public:
static std::string GetSchema();
static void ClassInit(CComponentManager& componentManager);
virtual void Init(const CParamNode& paramNode);
virtual void Deinit();
void Init(const CParamNode& paramNode) override;
void Deinit() override;
virtual void Serialize(ISerializer& UNUSED(serialize));
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize));
void Serialize(ISerializer& UNUSED(serialize)) override;
void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override;
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global));
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override;
/*
* Must be called whenever m_Displayed or the size of m_RallyPoints change,
@ -86,22 +86,22 @@ public:
*/
virtual void UpdateMessageSubscriptions();
virtual void AddPosition_wrapper(const CFixedVector2D& pos);
void AddPosition_wrapper(const CFixedVector2D& pos) override;
virtual void SetPosition(const CFixedVector2D& pos);
void SetPosition(const CFixedVector2D& pos) override;
virtual void UpdatePosition(u32 rallyPointId, const CFixedVector2D& pos);
void UpdatePosition(u32 rallyPointId, const CFixedVector2D& pos) override;
virtual void SetDisplayed(bool displayed);
void SetDisplayed(bool displayed) override;
virtual void Reset();
void Reset() override;
virtual void UpdateColor();
void UpdateColor() override;
/**
* Returns true if at least one display rally point is set; i.e., if we have a point to render our marker/line at.
*/
virtual bool IsSet() const;
bool IsSet() const override;
DEFAULT_COMPONENT_ALLOCATOR(RallyPointRenderer)

View File

@ -436,7 +436,7 @@ public:
return "<a:component type='system'/><empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
m_QueryNext = 1;
@ -462,7 +462,7 @@ public:
m_LosVerticesPerSide = 0;
}
virtual void Deinit()
void Deinit() override
{
}
@ -496,19 +496,19 @@ public:
Serializer(serialize, "shared dirty visibility masks", m_SharedDirtyVisibilityMasks);
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
SerializeCommon(serialize);
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize)
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override
{
Init(paramNode);
SerializeCommon(deserialize);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -781,7 +781,7 @@ public:
}
}
virtual void SetBounds(entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1)
void SetBounds(entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1) override
{
// Don't support rectangular looking maps.
ENSURE(x1-x0 == z1-z0);
@ -794,7 +794,7 @@ public:
ResetDerivedData();
}
virtual void Verify()
void Verify() override
{
// Ignore if map not initialised yet
if (m_WorldX1.IsZero())
@ -844,7 +844,7 @@ public:
debug_warn(L"inconsistent los regions");
}
FastSpatialSubdivision* GetSubdivision()
FastSpatialSubdivision* GetSubdivision() override
{
return &m_Subdivision;
}
@ -921,9 +921,9 @@ public:
m_Subdivision.Add(it->first, CFixedVector2D(it->second.x, it->second.z), it->second.size);
}
virtual tag_t CreateActiveQuery(entity_id_t source,
tag_t CreateActiveQuery(entity_id_t source,
entity_pos_t minRange, entity_pos_t maxRange,
const std::vector<int>& owners, int requiredInterface, u8 flags, bool accountForSize)
const std::vector<int>& owners, int requiredInterface, u8 flags, bool accountForSize) override
{
tag_t id = m_QueryNext++;
m_Queries[id] = ConstructQuery(source, minRange, maxRange, owners, requiredInterface, flags, accountForSize);
@ -931,9 +931,9 @@ public:
return id;
}
virtual tag_t CreateActiveParabolicQuery(entity_id_t source,
tag_t CreateActiveParabolicQuery(entity_id_t source,
entity_pos_t minRange, entity_pos_t maxRange, entity_pos_t yOrigin,
const std::vector<int>& owners, int requiredInterface, u8 flags)
const std::vector<int>& owners, int requiredInterface, u8 flags) override
{
tag_t id = m_QueryNext++;
m_Queries[id] = ConstructParabolicQuery(source, minRange, maxRange, yOrigin, owners, requiredInterface, flags, true);
@ -941,7 +941,7 @@ public:
return id;
}
virtual void DestroyActiveQuery(tag_t tag)
void DestroyActiveQuery(tag_t tag) override
{
if (m_Queries.find(tag) == m_Queries.end())
{
@ -952,7 +952,7 @@ public:
m_Queries.erase(tag);
}
virtual void EnableActiveQuery(tag_t tag)
void EnableActiveQuery(tag_t tag) override
{
std::map<tag_t, Query>::iterator it = m_Queries.find(tag);
if (it == m_Queries.end())
@ -965,7 +965,7 @@ public:
q.enabled = true;
}
virtual void DisableActiveQuery(tag_t tag)
void DisableActiveQuery(tag_t tag) override
{
std::map<tag_t, Query>::iterator it = m_Queries.find(tag);
if (it == m_Queries.end())
@ -978,7 +978,7 @@ public:
q.enabled = false;
}
virtual bool IsActiveQueryEnabled(tag_t tag) const
bool IsActiveQueryEnabled(tag_t tag) const override
{
std::map<tag_t, Query>::const_iterator it = m_Queries.find(tag);
if (it == m_Queries.end())
@ -991,9 +991,9 @@ public:
return q.enabled;
}
virtual std::vector<entity_id_t> ExecuteQueryAroundPos(const CFixedVector2D& pos,
std::vector<entity_id_t> ExecuteQueryAroundPos(const CFixedVector2D& pos,
entity_pos_t minRange, entity_pos_t maxRange,
const std::vector<int>& owners, int requiredInterface, bool accountForSize)
const std::vector<int>& owners, int requiredInterface, bool accountForSize) override
{
Query q = ConstructQuery(INVALID_ENTITY, minRange, maxRange, owners, requiredInterface, GetEntityFlagMask("normal"), accountForSize);
std::vector<entity_id_t> r;
@ -1005,9 +1005,9 @@ public:
return r;
}
virtual std::vector<entity_id_t> ExecuteQuery(entity_id_t source,
std::vector<entity_id_t> ExecuteQuery(entity_id_t source,
entity_pos_t minRange, entity_pos_t maxRange,
const std::vector<int>& owners, int requiredInterface, bool accountForSize)
const std::vector<int>& owners, int requiredInterface, bool accountForSize) override
{
PROFILE("ExecuteQuery");
@ -1031,7 +1031,7 @@ public:
return r;
}
virtual std::vector<entity_id_t> ResetActiveQuery(tag_t tag)
std::vector<entity_id_t> ResetActiveQuery(tag_t tag) override
{
PROFILE("ResetActiveQuery");
@ -1066,17 +1066,17 @@ public:
return r;
}
virtual std::vector<entity_id_t> GetEntitiesByPlayer(player_id_t player) const
std::vector<entity_id_t> GetEntitiesByPlayer(player_id_t player) const override
{
return GetEntitiesByMask(CalcOwnerMask(player));
}
virtual std::vector<entity_id_t> GetNonGaiaEntities() const
std::vector<entity_id_t> GetNonGaiaEntities() const override
{
return GetEntitiesByMask(~3u); // bit 0 for owner=-1 and bit 1 for gaia
}
virtual std::vector<entity_id_t> GetGaiaAndNonGaiaEntities() const
std::vector<entity_id_t> GetGaiaAndNonGaiaEntities() const override
{
return GetEntitiesByMask(~1u); // bit 0 for owner=-1
}
@ -1095,7 +1095,7 @@ public:
return entities;
}
virtual void SetDebugOverlay(bool enabled)
void SetDebugOverlay(bool enabled) override
{
m_DebugOverlayEnabled = enabled;
m_DebugOverlayDirty = true;
@ -1279,7 +1279,7 @@ public:
}
}
virtual entity_pos_t GetEffectiveParabolicRange(entity_id_t source, entity_id_t target, entity_pos_t range, entity_pos_t yOrigin) const
entity_pos_t GetEffectiveParabolicRange(entity_id_t source, entity_id_t target, entity_pos_t range, entity_pos_t yOrigin) const override
{
// For non-positive ranges, just return the range.
if (range < entity_pos_t::Zero())
@ -1302,7 +1302,7 @@ public:
return effectiveRange;
}
virtual entity_pos_t GetElevationAdaptedRange(const CFixedVector3D& pos1, const CFixedVector3D& rot, entity_pos_t range, entity_pos_t yOrigin, entity_pos_t angle) const
entity_pos_t GetElevationAdaptedRange(const CFixedVector3D& pos1, const CFixedVector3D& rot, entity_pos_t range, entity_pos_t yOrigin, entity_pos_t angle) const override
{
entity_pos_t r = entity_pos_t::Zero();
CFixedVector3D pos(pos1);
@ -1604,7 +1604,7 @@ public:
collector.Submit(&m_DebugOverlayLines[i]);
}
virtual u8 GetEntityFlagMask(const std::string& identifier) const
u8 GetEntityFlagMask(const std::string& identifier) const override
{
if (identifier == "normal")
return FlagMasks::Normal;
@ -1615,7 +1615,7 @@ public:
return FlagMasks::None;
}
virtual void SetEntityFlag(entity_id_t ent, const std::string& identifier, bool value)
void SetEntityFlag(entity_id_t ent, const std::string& identifier, bool value) override
{
EntityMap<EntityData>::iterator it = m_EntityData.find(ent);
@ -1635,7 +1635,7 @@ public:
// LOS implementation:
virtual CLosQuerier GetLosQuerier(player_id_t player) const
CLosQuerier GetLosQuerier(player_id_t player) const override
{
if (GetLosRevealAll(player))
return CLosQuerier(0xFFFFFFFFu, m_LosStateRevealed, m_LosVerticesPerSide);
@ -1643,7 +1643,7 @@ public:
return CLosQuerier(GetSharedLosMask(player), m_LosState, m_LosVerticesPerSide);
}
virtual void ActivateScriptedVisibility(entity_id_t ent, bool status)
void ActivateScriptedVisibility(entity_id_t ent, bool status) override
{
EntityMap<EntityData>::iterator it = m_EntityData.find(ent);
if (it != m_EntityData.end())
@ -1753,7 +1753,7 @@ public:
return ComputeLosVisibility(handle, player);
}
virtual LosVisibility GetLosVisibility(CEntityHandle ent, player_id_t player) const
LosVisibility GetLosVisibility(CEntityHandle ent, player_id_t player) const override
{
entity_id_t entId = ent.GetId();
@ -1784,13 +1784,13 @@ public:
return static_cast<LosVisibility>(GetPlayerVisibility(it->second.visibilities, player));
}
virtual LosVisibility GetLosVisibility(entity_id_t ent, player_id_t player) const
LosVisibility GetLosVisibility(entity_id_t ent, player_id_t player) const override
{
CEntityHandle handle = GetSimContext().GetComponentManager().LookupEntityHandle(ent);
return GetLosVisibility(handle, player);
}
virtual LosVisibility GetLosVisibilityPosition(entity_pos_t x, entity_pos_t z, player_id_t player) const
LosVisibility GetLosVisibilityPosition(entity_pos_t x, entity_pos_t z, player_id_t player) const override
{
int i = (x / LOS_TILE_SIZE).ToInt_RoundToNearest();
int j = (z / LOS_TILE_SIZE).ToInt_RoundToNearest();
@ -1814,7 +1814,7 @@ public:
return LosVisibility::HIDDEN;
}
size_t GetVerticesPerSide() const
size_t GetVerticesPerSide() const override
{
return m_LosVerticesPerSide;
}
@ -1886,7 +1886,7 @@ public:
}
}
virtual void RequestVisibilityUpdate(entity_id_t ent)
void RequestVisibilityUpdate(entity_id_t ent) override
{
if (std::find(m_ModifiedEntities.begin(), m_ModifiedEntities.end(), ent) == m_ModifiedEntities.end())
m_ModifiedEntities.push_back(ent);
@ -1916,7 +1916,7 @@ public:
UpdateVisibility(ent, player);
}
virtual void SetLosRevealAll(player_id_t player, bool enabled)
void SetLosRevealAll(player_id_t player, bool enabled) override
{
if (player == -1)
m_LosRevealAll[MAX_LOS_PLAYER_ID+1] = enabled;
@ -1930,7 +1930,7 @@ public:
m_GlobalVisibilityUpdate = true;
}
virtual bool GetLosRevealAll(player_id_t player) const
bool GetLosRevealAll(player_id_t player) const override
{
// Special player value can force reveal-all for every player
if (m_LosRevealAll[MAX_LOS_PLAYER_ID+1] || player == -1)
@ -1943,19 +1943,19 @@ public:
return false;
}
virtual void SetLosCircular(bool enabled)
void SetLosCircular(bool enabled) override
{
m_LosCircular = enabled;
ResetDerivedData();
}
virtual bool GetLosCircular() const
bool GetLosCircular() const override
{
return m_LosCircular;
}
virtual void SetSharedLos(player_id_t player, const std::vector<player_id_t>& players)
void SetSharedLos(player_id_t player, const std::vector<player_id_t>& players) override
{
m_SharedLosMasks[player] = CalcSharedLosMask(players);
@ -1977,12 +1977,12 @@ public:
m_GlobalPlayerVisibilityUpdate[player-1] = 1;
}
virtual u32 GetSharedLosMask(player_id_t player) const
u32 GetSharedLosMask(player_id_t player) const override
{
return m_SharedLosMasks[player];
}
void ExploreMap(player_id_t p)
void ExploreMap(player_id_t p) override
{
for (i32 j = 0; j < m_LosVerticesPerSide; ++j)
for (i32 i = 0; i < m_LosVerticesPerSide; ++i)
@ -1997,7 +1997,7 @@ public:
SeeExploredEntities(p);
}
virtual void ExploreTerritories()
void ExploreTerritories() override
{
PROFILE3("ExploreTerritories");
@ -2080,7 +2080,7 @@ public:
}
}
virtual void RevealShore(player_id_t p, bool enable)
void RevealShore(player_id_t p, bool enable) override
{
if (p <= 0 || p > MAX_LOS_PLAYER_ID)
return;
@ -2494,12 +2494,12 @@ public:
LosMove(i, visionRange, from, to);
}
virtual u8 GetPercentMapExplored(player_id_t player) const
u8 GetPercentMapExplored(player_id_t player) const override
{
return m_ExploredVertices.at((u8)player) * 100 / m_TotalInworldVertices;
}
virtual u8 GetUnionPercentMapExplored(const std::vector<player_id_t>& players) const
u8 GetUnionPercentMapExplored(const std::vector<player_id_t>& players) const override
{
u32 exploredVertices = 0;
std::vector<player_id_t>::const_iterator playerIt;

View File

@ -56,31 +56,31 @@ public:
return "<a:component type='system'/><empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
m_Enabled = m_LastEnabledState = false;
UpdateMessageSubscriptions();
}
virtual void Deinit() { }
void Deinit() override { }
virtual void Serialize(ISerializer& UNUSED(serialize))
void Serialize(ISerializer& UNUSED(serialize)) override
{
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize))
void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override
{
Init(paramNode);
}
void ResetRangeOverlays()
void ResetRangeOverlays() override
{
m_RangeOverlayData.clear();
UpdateMessageSubscriptions();
m_Enabled = false;
}
virtual void AddRangeOverlay(float radius, const std::string& texture, const std::string& textureMask, float thickness)
void AddRangeOverlay(float radius, const std::string& texture, const std::string& textureMask, float thickness) override
{
if (!CRenderer::IsInitialised())
return;
@ -98,7 +98,7 @@ public:
UpdateMessageSubscriptions();
}
void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -135,7 +135,7 @@ private:
std::unique_ptr<SOverlayTexturedLine> line;
};
virtual void UpdateColor()
void UpdateColor() override
{
CmpPtr<ICmpOwnership> cmpOwnership(GetEntityHandle());
if (!cmpOwnership)

View File

@ -149,7 +149,7 @@ public:
entity_pos_t m_Width; // width/radius
entity_pos_t m_Height; // height/radius
virtual void Init(const CParamNode& paramNode)
void Init(const CParamNode& paramNode) override
{
m_EditorOnly = paramNode.GetChild("EditorOnly").IsOk();
@ -215,23 +215,23 @@ public:
UpdateMessageSubscriptions();
}
virtual void Deinit() { }
void Deinit() override { }
virtual void Serialize(ISerializer& UNUSED(serialize))
void Serialize(ISerializer& UNUSED(serialize)) override
{
// Nothing to do here (the overlay object is not worth saving, it'll get
// reconstructed by the GUI soon enough, I think)
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize))
void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override
{
// Need to call Init to reload the template properties
Init(paramNode);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global));
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override;
virtual void SetSelectionHighlight(const CColor& color, bool selected)
void SetSelectionHighlight(const CColor& color, bool selected) override
{
m_Selected = selected;
m_Color.r = color.r;
@ -257,7 +257,7 @@ public:
SetSelectionHighlightAlpha(color.a);
}
virtual void SetSelectionHighlightAlpha(float alpha)
void SetSelectionHighlightAlpha(float alpha) override
{
alpha = std::max(m_AlphaMin, alpha);
@ -269,13 +269,13 @@ public:
UpdateMessageSubscriptions();
}
virtual void SetVisibility(bool visible)
void SetVisibility(bool visible) override
{
m_Visible = visible;
UpdateMessageSubscriptions();
}
virtual bool IsEditorOnly() const
bool IsEditorOnly() const override
{
return m_EditorOnly;
}
@ -309,7 +309,7 @@ public:
/**
* Set the color of the current owner.
*/
virtual void UpdateColor();
void UpdateColor() override;
private:
SOverlayDescriptor m_OverlayDescriptor;

View File

@ -41,26 +41,26 @@ public:
return "<a:component type='system'/><empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& UNUSED(serialize))
void Serialize(ISerializer& UNUSED(serialize)) override
{
// Do nothing here - sounds are purely local, and don't need to be preserved across saved games etc
// (If we add music support in here then we might want to save the music state, though)
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize))
void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override
{
Init(paramNode);
}
virtual void PlaySoundGroup(const std::wstring& name, entity_id_t source)
void PlaySoundGroup(const std::wstring& name, entity_id_t source) override
{
if (!g_SoundManager || (source == INVALID_ENTITY))
return;
@ -84,21 +84,21 @@ public:
g_SoundManager->PlayAsGroup(name, sourcePos, source, playerOwned);
}
virtual void PlaySoundGroupAtPosition(const std::wstring& name, const CFixedVector3D& sourcePos)
void PlaySoundGroupAtPosition(const std::wstring& name, const CFixedVector3D& sourcePos) override
{
if (!g_SoundManager)
return;
g_SoundManager->PlayAsGroup(name, CVector3D(sourcePos), INVALID_ENTITY, false);
}
virtual void PlaySoundGroupForPlayer(const VfsPath& groupPath, const player_id_t playerId) const
void PlaySoundGroupForPlayer(const VfsPath& groupPath, const player_id_t playerId) const override
{
if (!g_SoundManager)
return;
g_SoundManager->PlayAsGroup(groupPath, CVector3D(0.f, 0.f, 0.f), INVALID_ENTITY, GetSimContext().GetCurrentDisplayedPlayer() == playerId);
}
virtual void StopMusic()
void StopMusic() override
{
if (!g_SoundManager)
return;

View File

@ -43,7 +43,7 @@ public:
return "<a:component type='system'/><empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
m_DisableValidation = false;
@ -52,11 +52,11 @@ public:
// TODO: support hotloading changes to the grammar
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
std::map<std::string, std::vector<entity_id_t>> templateMap;
@ -67,7 +67,7 @@ public:
Serializer(serialize, "templates", templateMap);
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize)
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override
{
Init(paramNode);
@ -78,7 +78,7 @@ public:
m_LatestTemplates[id] = mapEl.first;
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -94,30 +94,30 @@ public:
}
}
virtual void DisableValidation()
void DisableValidation() override
{
m_DisableValidation = true;
}
virtual const CParamNode* LoadTemplate(entity_id_t ent, const std::string& templateName);
const CParamNode* LoadTemplate(entity_id_t ent, const std::string& templateName) override;
virtual const CParamNode* GetTemplate(const std::string& templateName);
const CParamNode* GetTemplate(const std::string& templateName) override;
virtual const CParamNode* GetTemplateWithoutValidation(const std::string& templateName);
const CParamNode* GetTemplateWithoutValidation(const std::string& templateName) override;
virtual bool TemplateExists(const std::string& templateName) const;
bool TemplateExists(const std::string& templateName) const override;
virtual const CParamNode* LoadLatestTemplate(entity_id_t ent);
const CParamNode* LoadLatestTemplate(entity_id_t ent) override;
virtual std::string GetCurrentTemplateName(entity_id_t ent) const;
std::string GetCurrentTemplateName(entity_id_t ent) const override;
virtual std::vector<std::string> FindAllTemplates(bool includeActors) const;
std::vector<std::string> FindAllTemplates(bool includeActors) const override;
virtual std::vector<std::vector<std::wstring>> GetCivData();
std::vector<std::vector<std::wstring>> GetCivData() override;
virtual std::vector<std::string> FindUsedTemplates() const;
std::vector<std::string> FindUsedTemplates() const override;
virtual std::vector<entity_id_t> GetEntitiesUsingTemplate(const std::string& templateName) const;
std::vector<entity_id_t> GetEntitiesUsingTemplate(const std::string& templateName) const override;
private:
// Template loader

View File

@ -45,54 +45,54 @@ public:
return "<a:component type='system'/><empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
m_Terrain = &GetSimContext().GetTerrain();
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& UNUSED(serialize))
void Serialize(ISerializer& UNUSED(serialize)) override
{
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize))
void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override
{
Init(paramNode);
}
virtual bool IsLoaded() const
bool IsLoaded() const override
{
return m_Terrain->GetVerticesPerSide() != 0;
}
virtual CFixedVector3D CalcNormal(entity_pos_t x, entity_pos_t z) const
CFixedVector3D CalcNormal(entity_pos_t x, entity_pos_t z) const override
{
CFixedVector3D normal;
m_Terrain->CalcNormalFixed((x / (int)TERRAIN_TILE_SIZE).ToInt_RoundToZero(), (z / (int)TERRAIN_TILE_SIZE).ToInt_RoundToZero(), normal);
return normal;
}
virtual CVector3D CalcExactNormal(float x, float z) const
CVector3D CalcExactNormal(float x, float z) const override
{
return m_Terrain->CalcExactNormal(x, z);
}
virtual entity_pos_t GetGroundLevel(entity_pos_t x, entity_pos_t z) const
entity_pos_t GetGroundLevel(entity_pos_t x, entity_pos_t z) const override
{
// TODO: this can crash if the terrain heightmap isn't initialised yet
return m_Terrain->GetExactGroundLevelFixed(x, z);
}
virtual float GetExactGroundLevel(float x, float z) const
float GetExactGroundLevel(float x, float z) const override
{
return m_Terrain->GetExactGroundLevel(x, z);
}
virtual u16 GetTilesPerSide() const
u16 GetTilesPerSide() const override
{
ssize_t tiles = m_Terrain->GetTilesPerSide();
@ -102,24 +102,24 @@ public:
return (u16)tiles;
}
virtual u32 GetMapSize() const
u32 GetMapSize() const override
{
return GetTilesPerSide() * TERRAIN_TILE_SIZE;
}
virtual u16 GetVerticesPerSide() const
u16 GetVerticesPerSide() const override
{
ssize_t vertices = m_Terrain->GetVerticesPerSide();
ENSURE(1 <= vertices && vertices <= 65535);
return (u16)vertices;
}
virtual CTerrain* GetCTerrain()
CTerrain* GetCTerrain() override
{
return m_Terrain;
}
virtual void ReloadTerrain(bool ReloadWater)
void ReloadTerrain(bool ReloadWater) override
{
// TODO: should refactor this code to be nicer
@ -150,7 +150,7 @@ public:
MakeDirty(0, 0, tiles+1, tiles+1);
}
virtual void MakeDirty(i32 i0, i32 j0, i32 i1, i32 j1)
void MakeDirty(i32 i0, i32 j0, i32 i1, i32 j1) override
{
CMessageTerrainChanged msg(i0, j0, i1, j1);
GetSimContext().GetComponentManager().BroadcastMessage(msg);

View File

@ -53,27 +53,27 @@ public:
"</element>";
}
virtual void Init(const CParamNode& paramNode)
void Init(const CParamNode& paramNode) override
{
m_Root = paramNode.GetChild("Root").ToBool();
m_Weight = (u16)paramNode.GetChild("Weight").ToInt();
m_Radius = paramNode.GetChild("Radius").ToInt();
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& UNUSED(serialize))
void Serialize(ISerializer& UNUSED(serialize)) override
{
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize))
void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override
{
Init(paramNode);
}
virtual bool IsRoot() const
bool IsRoot() const override
{
CmpPtr<ICmpValueModificationManager> cmpValueModificationManager(GetSystemEntity());
if (!cmpValueModificationManager)
@ -82,7 +82,7 @@ public:
return cmpValueModificationManager->ApplyModifications(L"TerritoryInfluence/Root", m_Root, GetEntityId());
}
virtual u16 GetWeight() const
u16 GetWeight() const override
{
CmpPtr<ICmpValueModificationManager> cmpValueModificationManager(GetSystemEntity());
if (!cmpValueModificationManager)
@ -91,7 +91,7 @@ public:
return cmpValueModificationManager->ApplyModifications(L"TerritoryInfluence/Weight", m_Weight, GetEntityId());
}
virtual u32 GetRadius() const
u32 GetRadius() const override
{
CmpPtr<ICmpValueModificationManager> cmpValueModificationManager(GetSystemEntity());
if (!cmpValueModificationManager)

View File

@ -52,7 +52,7 @@ public:
CCmpTerritoryManager& m_TerritoryManager;
TerritoryOverlay(CCmpTerritoryManager& manager);
virtual void BuildTextureRGBA(u8* data, size_t w, size_t h);
void BuildTextureRGBA(u8* data, size_t w, size_t h) override;
};
class CCmpTerritoryManager : public ICmpTerritoryManager
@ -117,7 +117,7 @@ public:
bool m_EnableLineDebugOverlays; ///< Enable node debugging overlays for boundary lines?
std::vector<SOverlayLine> m_DebugBoundaryLineNodes;
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
m_Territories = NULL;
m_CostGrid = NULL;
@ -148,26 +148,26 @@ public:
m_BorderSeparation = externalParamNode.GetChild("TerritoryManager").GetChild("BorderSeparation").ToFixed().ToFloat();
}
virtual void Deinit()
void Deinit() override
{
SAFE_DELETE(m_Territories);
SAFE_DELETE(m_CostGrid);
SAFE_DELETE(m_DebugOverlay);
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
// Territory state can be recomputed as required, so we don't need to serialize any of it.
serialize.Bool("trigger event", m_TriggerEvent);
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize)
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override
{
Init(paramNode);
deserialize.Bool("trigger event", m_TriggerEvent);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -237,19 +237,19 @@ public:
MakeDirty();
}
virtual const Grid<u8>& GetTerritoryGrid()
const Grid<u8>& GetTerritoryGrid() override
{
CalculateTerritories();
ENSURE(m_Territories);
return *m_Territories;
}
virtual player_id_t GetOwner(entity_pos_t x, entity_pos_t z);
virtual std::vector<u32> GetNeighbours(entity_pos_t x, entity_pos_t z, bool filterConnected);
virtual bool IsConnected(entity_pos_t x, entity_pos_t z);
player_id_t GetOwner(entity_pos_t x, entity_pos_t z) override;
std::vector<u32> GetNeighbours(entity_pos_t x, entity_pos_t z, bool filterConnected) override;
bool IsConnected(entity_pos_t x, entity_pos_t z) override;
virtual void SetTerritoryBlinking(entity_pos_t x, entity_pos_t z, bool enable);
virtual bool IsTerritoryBlinking(entity_pos_t x, entity_pos_t z);
void SetTerritoryBlinking(entity_pos_t x, entity_pos_t z, bool enable) override;
bool IsTerritoryBlinking(entity_pos_t x, entity_pos_t z) override;
// To support lazy updates of territory render data,
// we maintain a DirtyID here and increment it whenever territories change;
@ -269,7 +269,7 @@ public:
m_TriggerEvent = true;
}
virtual bool NeedUpdateTexture(size_t* dirtyID)
bool NeedUpdateTexture(size_t* dirtyID) override
{
if (*dirtyID == m_DirtyID && !m_ColorChanged)
return false;
@ -279,7 +279,7 @@ public:
return true;
}
virtual bool NeedUpdateAI(size_t* dirtyID, size_t* dirtyBlinkingID) const
bool NeedUpdateAI(size_t* dirtyID, size_t* dirtyBlinkingID) const override
{
if (*dirtyID == m_DirtyID && *dirtyBlinkingID == m_DirtyBlinkingID)
return false;
@ -293,7 +293,7 @@ public:
void CalculateTerritories();
u8 GetTerritoryPercentage(player_id_t player);
u8 GetTerritoryPercentage(player_id_t player) override;
std::vector<STerritoryBoundary> ComputeBoundaries();
@ -303,12 +303,12 @@ public:
void RenderSubmit(SceneCollector& collector, const CFrustum& frustum, bool culling);
void SetVisibility(bool visible)
void SetVisibility(bool visible) override
{
m_Visible = visible;
}
void UpdateColors();
void UpdateColors() override;
private:

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -42,7 +42,7 @@ public:
return "<a:component type='test'/><ref name='anything'/>";
}
virtual void Init(const CParamNode& paramNode)
void Init(const CParamNode& paramNode) override
{
if (paramNode.GetChild("x").IsOk())
m_x = paramNode.GetChild("x").ToInt();
@ -50,26 +50,26 @@ public:
m_x = 11000;
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
serialize.NumberI32_Unbounded("x", m_x);
}
virtual void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize)
void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) override
{
deserialize.NumberI32_Unbounded("x", m_x);
}
virtual int GetX()
int GetX() override
{
return m_x;
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -109,31 +109,31 @@ public:
return "<a:component type='test'/><empty/>";
}
virtual void Init(const CParamNode&)
void Init(const CParamNode&) override
{
m_x = 12000;
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
serialize.NumberI32_Unbounded("x", m_x);
}
virtual void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize)
void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) override
{
deserialize.NumberI32_Unbounded("x", m_x);
}
virtual int GetX()
int GetX() override
{
return m_x;
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -170,31 +170,31 @@ public:
return "<a:component type='test'/><empty/>";
}
virtual void Init(const CParamNode&)
void Init(const CParamNode&) override
{
m_x = 21000;
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
serialize.NumberI32_Unbounded("x", m_x);
}
virtual void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize)
void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) override
{
deserialize.NumberI32_Unbounded("x", m_x);
}
virtual int GetX()
int GetX() override
{
return m_x;
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -220,7 +220,7 @@ class CCmpTest1Scripted : public ICmpTest1
public:
DEFAULT_SCRIPT_WRAPPER(Test1Scripted)
virtual int GetX()
int GetX() override
{
return m_Script.Call<int> ("GetX");
}
@ -235,7 +235,7 @@ class CCmpTest2Scripted : public ICmpTest2
public:
DEFAULT_SCRIPT_WRAPPER(Test2Scripted)
virtual int GetX()
int GetX() override
{
return m_Script.Call<int> ("GetX");
}

View File

@ -280,7 +280,7 @@ public:
"</optional>";
}
virtual void Init(const CParamNode& paramNode)
void Init(const CParamNode& paramNode) override
{
m_IsFormationController = paramNode.GetChild("FormationController").ToBool();
@ -320,7 +320,7 @@ public:
m_DebugOverlayEnabled = false;
}
virtual void Deinit()
void Deinit() override
{
}
@ -360,12 +360,12 @@ public:
Serializer(serialize, "short path", m_ShortPath.m_Waypoints);
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
SerializeCommon(serialize);
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize)
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override
{
Init(paramNode);
@ -380,7 +380,7 @@ public:
m_BlockMovement = cmpObstruction->GetBlockMovementFlag(false);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -442,38 +442,38 @@ public:
GetSimContext().GetComponentManager().DynamicSubscriptionNonsync(MT_RenderSubmit, this, needRender);
}
virtual bool IsMoveRequested() const
bool IsMoveRequested() const override
{
return m_MoveRequest.m_Type != MoveRequest::NONE;
}
virtual fixed GetSpeedMultiplier() const
fixed GetSpeedMultiplier() const override
{
return m_SpeedMultiplier;
}
virtual void SetSpeedMultiplier(fixed multiplier)
void SetSpeedMultiplier(fixed multiplier) override
{
m_SpeedMultiplier = std::min(multiplier, m_RunMultiplier);
m_Speed = m_SpeedMultiplier.Multiply(GetWalkSpeed());
}
virtual fixed GetSpeed() const
fixed GetSpeed() const override
{
return m_Speed;
}
virtual fixed GetWalkSpeed() const
fixed GetWalkSpeed() const override
{
return m_WalkSpeed;
}
virtual fixed GetRunMultiplier() const
fixed GetRunMultiplier() const override
{
return m_RunMultiplier;
}
virtual CFixedVector2D EstimateFuturePosition(const fixed dt) const
CFixedVector2D EstimateFuturePosition(const fixed dt) const override
{
CmpPtr<ICmpPosition> cmpPosition(GetEntityHandle());
if (!cmpPosition || !cmpPosition->IsInWorld())
@ -492,12 +492,12 @@ public:
return pos;
}
virtual fixed GetAcceleration() const
fixed GetAcceleration() const override
{
return m_Acceleration;
}
virtual void SetAcceleration(fixed acceleration)
void SetAcceleration(fixed acceleration) override
{
m_Acceleration = acceleration;
}
@ -507,12 +507,12 @@ public:
return m_TemplateWeight;
}
virtual pass_class_t GetPassabilityClass() const
pass_class_t GetPassabilityClass() const override
{
return m_PassClass;
}
virtual std::string GetPassabilityClassName() const
std::string GetPassabilityClassName() const override
{
return m_PassClassName;
}
@ -525,58 +525,58 @@ public:
m_PassClass = cmpPathfinder->GetPassabilityClass(passClassName);
}
virtual fixed GetCurrentSpeed() const
fixed GetCurrentSpeed() const override
{
return m_CurrentSpeed;
}
virtual void SetFacePointAfterMove(bool facePointAfterMove)
void SetFacePointAfterMove(bool facePointAfterMove) override
{
m_FacePointAfterMove = facePointAfterMove;
}
virtual bool GetFacePointAfterMove() const
bool GetFacePointAfterMove() const override
{
return m_FacePointAfterMove;
}
virtual void SetDebugOverlay(bool enabled)
void SetDebugOverlay(bool enabled) override
{
m_DebugOverlayEnabled = enabled;
UpdateMessageSubscriptions();
}
virtual bool MoveToPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange)
bool MoveToPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange) override
{
return MoveTo(MoveRequest(CFixedVector2D(x, z), minRange, maxRange));
}
virtual bool MoveToTargetRange(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange)
bool MoveToTargetRange(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) override
{
return MoveTo(MoveRequest(target, minRange, maxRange));
}
virtual void MoveToFormationOffset(entity_id_t controller, entity_pos_t x, entity_pos_t z)
void MoveToFormationOffset(entity_id_t controller, entity_pos_t x, entity_pos_t z) override
{
// Pass the controller to the move request anyways.
MoveTo(MoveRequest(controller, CFixedVector2D(x, z)));
}
virtual void SetMemberOfFormation(entity_id_t controller)
void SetMemberOfFormation(entity_id_t controller) override
{
m_FormationController = controller;
}
virtual bool IsTargetRangeReachable(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange);
bool IsTargetRangeReachable(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) override;
virtual void FaceTowardsPoint(entity_pos_t x, entity_pos_t z);
void FaceTowardsPoint(entity_pos_t x, entity_pos_t z) override;
/**
* Clears the current MoveRequest - the unit will stop and no longer try and move.
* This should never be called from UnitMotion, since MoveToX orders are given
* by other components - these components should also decide when to stop.
*/
virtual void StopMoving()
void StopMoving() override
{
if (m_FacePointAfterMove)
{
@ -595,7 +595,7 @@ public:
m_ShortPath.m_Waypoints.clear();
}
virtual entity_pos_t GetUnitClearance() const
entity_pos_t GetUnitClearance() const override
{
return m_Clearance;
}

View File

@ -125,26 +125,26 @@ public:
return "<a:component type='system'/><empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode));
void Init(const CParamNode& UNUSED(paramNode)) override;
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& serialize);
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize);
void Serialize(ISerializer& serialize) override;
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override;
virtual void HandleMessage(const CMessage& msg, bool global);
void HandleMessage(const CMessage& msg, bool global) override;
virtual void Register(CCmpUnitMotion* component, entity_id_t ent, bool formationController);
virtual void Unregister(entity_id_t ent);
void Register(CCmpUnitMotion* component, entity_id_t ent, bool formationController) override;
void Unregister(entity_id_t ent) override;
virtual bool ComputingMotion() const
bool ComputingMotion() const override
{
return m_ComputingMotion;
}
virtual bool IsPushingActivated() const
bool IsPushingActivated() const override
{
return m_PushingRadiusMultiplier != entity_pos_t::Zero();
}

View File

@ -138,27 +138,27 @@ public:
return "<a:component type='system'/><empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
m_FrameNumber = 0;
m_FrameOffset = 0.0f;
m_EnableDebugOverlays = false;
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& UNUSED(serialize))
void Serialize(ISerializer& UNUSED(serialize)) override
{
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize))
void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override
{
Init(paramNode);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -189,7 +189,7 @@ public:
return &m_Units[tag.n - 1];
}
virtual tag_t AddUnit(CEntityHandle entity, CUnit* actor, const CBoundingSphere& boundsApprox, int flags)
tag_t AddUnit(CEntityHandle entity, CUnit* actor, const CBoundingSphere& boundsApprox, int flags) override
{
ENSURE(actor != NULL);
@ -218,7 +218,7 @@ public:
return tag;
}
virtual void RemoveUnit(tag_t tag)
void RemoveUnit(tag_t tag) override
{
SUnit* unit = LookupUnit(tag);
unit->actor = NULL;
@ -235,7 +235,7 @@ public:
unit->sweptBounds = CBoundingSphere(mid, radius);
}
virtual void UpdateUnit(tag_t tag, CUnit* actor, const CBoundingSphere& boundsApprox)
void UpdateUnit(tag_t tag, CUnit* actor, const CBoundingSphere& boundsApprox) override
{
SUnit* unit = LookupUnit(tag);
unit->actor = actor;
@ -243,7 +243,7 @@ public:
RecomputeSweptBounds(unit);
}
virtual void UpdateUnitPos(tag_t tag, bool inWorld, const CVector3D& pos0, const CVector3D& pos1)
void UpdateUnitPos(tag_t tag, bool inWorld, const CVector3D& pos0, const CVector3D& pos1) override
{
SUnit* unit = LookupUnit(tag);
unit->inWorld = inWorld;
@ -259,17 +259,17 @@ public:
void UpdateVisibility(SUnit& unit) const;
virtual float GetFrameOffset() const
float GetFrameOffset() const override
{
return m_FrameOffset;
}
virtual void SetDebugOverlay(bool enabled)
void SetDebugOverlay(bool enabled) override
{
m_EnableDebugOverlays = enabled;
}
virtual void PickAllEntitiesAtPoint(std::vector<std::pair<CEntityHandle, CVector3D> >& outEntities, const CVector3D& origin, const CVector3D& dir, bool allowEditorSelectables) const
void PickAllEntitiesAtPoint(std::vector<std::pair<CEntityHandle, CVector3D> >& outEntities, const CVector3D& origin, const CVector3D& dir, bool allowEditorSelectables) const override
{
// First, make a rough test with the worst-case bounding boxes to pick all
// entities/models that could possibly be hit by the ray.

View File

@ -58,7 +58,7 @@ public:
"</optional>";
}
virtual void Init(const CParamNode& paramNode)
void Init(const CParamNode& paramNode) override
{
m_BaseRange = m_Range = paramNode.GetChild("Range").ToFixed();
@ -68,21 +68,21 @@ public:
m_RevealShore = false;
}
virtual void Deinit()
void Deinit() override
{
}
virtual void Serialize(ISerializer& UNUSED(serialize))
void Serialize(ISerializer& UNUSED(serialize)) override
{
// No dynamic state to serialize
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize))
void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override
{
Init(paramNode);
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -130,12 +130,12 @@ public:
GetSimContext().GetComponentManager().BroadcastMessage(msg);
}
virtual entity_pos_t GetRange() const
entity_pos_t GetRange() const override
{
return m_Range;
}
virtual bool GetRevealShore() const
bool GetRevealShore() const override
{
return m_RevealShore;
}

View File

@ -191,7 +191,7 @@ public:
"</element>";
}
virtual void Init(const CParamNode& paramNode)
void Init(const CParamNode& paramNode) override
{
m_Unit = NULL;
m_R = m_G = m_B = fixed::FromInt(1);
@ -220,7 +220,7 @@ public:
InitSelectionShapeDescriptor(paramNode);
}
virtual void Deinit()
void Deinit() override
{
if (m_Unit)
{
@ -252,7 +252,7 @@ public:
// TODO: store actor variables?
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
// TODO: store the actor name, if !debug and it differs from the template
@ -264,7 +264,7 @@ public:
SerializeCommon(serialize);
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize)
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override
{
Init(paramNode);
@ -288,7 +288,7 @@ public:
}
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -349,40 +349,40 @@ public:
}
}
virtual CBoundingBoxAligned GetBounds() const
CBoundingBoxAligned GetBounds() const override
{
if (!m_Unit)
return CBoundingBoxAligned::EMPTY;
return m_Unit->GetModel().GetWorldBounds();
}
virtual CUnit* GetUnit()
CUnit* GetUnit() override
{
return m_Unit;
}
virtual CBoundingBoxOriented GetSelectionBox() const
CBoundingBoxOriented GetSelectionBox() const override
{
if (!m_Unit)
return CBoundingBoxOriented::EMPTY;
return m_Unit->GetModel().GetSelectionBox();
}
virtual CVector3D GetPosition() const
CVector3D GetPosition() const override
{
if (!m_Unit)
return CVector3D(0, 0, 0);
return m_Unit->GetModel().GetTransform().GetTranslation();
}
virtual std::wstring GetProjectileActor() const
std::wstring GetProjectileActor() const override
{
if (!m_Unit)
return L"";
return m_Unit->GetObject().m_ProjectileModelName;
}
virtual CFixedVector3D GetProjectileLaunchPoint() const
CFixedVector3D GetProjectileLaunchPoint() const override
{
if (!m_Unit)
return CFixedVector3D();
@ -411,7 +411,7 @@ public:
return CFixedVector3D();
}
virtual void SetVariant(const CStr& key, const CStr& selection)
void SetVariant(const CStr& key, const CStr& selection) override
{
if (m_VariantSelections[key] == selection)
return;
@ -426,12 +426,12 @@ public:
}
}
virtual std::string GetAnimationName() const
std::string GetAnimationName() const override
{
return m_AnimName;
}
virtual void SelectAnimation(const std::string& name, bool once = false, fixed speed = fixed::FromInt(1))
void SelectAnimation(const std::string& name, bool once = false, fixed speed = fixed::FromInt(1)) override
{
m_AnimName = name;
m_AnimOnce = once;
@ -453,7 +453,7 @@ public:
m_Unit->GetAnimation()->SetAnimationState(m_AnimName, m_AnimOnce, m_AnimSpeed.ToFloat(), m_AnimDesync.ToFloat(), m_SoundGroup.c_str());
}
virtual void SelectMovementAnimation(const std::string& name, fixed speed)
void SelectMovementAnimation(const std::string& name, fixed speed) override
{
ENSURE(name == "idle" || name == "walk" || name == "run");
if (m_AnimName != "idle" && m_AnimName != "walk" && m_AnimName != "run")
@ -463,7 +463,7 @@ public:
SelectAnimation(name, false, speed);
}
virtual void SetAnimationSyncRepeat(fixed repeattime)
void SetAnimationSyncRepeat(fixed repeattime) override
{
m_AnimSyncRepeatTime = repeattime;
@ -471,7 +471,7 @@ public:
m_Unit->GetAnimation()->SetAnimationSyncRepeat(m_AnimSyncRepeatTime.ToFloat());
}
virtual void SetAnimationSyncOffset(fixed actiontime)
void SetAnimationSyncOffset(fixed actiontime) override
{
m_AnimSyncOffsetTime = actiontime;
@ -479,7 +479,7 @@ public:
m_Unit->GetAnimation()->SetAnimationSyncOffset(m_AnimSyncOffsetTime.ToFloat());
}
virtual void SetShadingColor(fixed r, fixed g, fixed b, fixed a)
void SetShadingColor(fixed r, fixed g, fixed b, fixed a) override
{
m_R = r;
m_G = g;
@ -493,18 +493,18 @@ public:
}
}
virtual void SetVariable(const std::string& name, float value)
void SetVariable(const std::string& name, float value) override
{
if (m_Unit)
m_Unit->GetModel().SetEntityVariable(name, value);
}
virtual u32 GetActorSeed() const
u32 GetActorSeed() const override
{
return m_Seed;
}
virtual void SetActorSeed(u32 seed)
void SetActorSeed(u32 seed) override
{
if (seed == m_Seed)
return;
@ -513,7 +513,7 @@ public:
ReloadActor();
}
virtual void RecomputeActorName()
void RecomputeActorName() override
{
CmpPtr<ICmpValueModificationManager> cmpValueModificationManager(GetSystemEntity());
std::wstring newActorName;
@ -529,12 +529,12 @@ public:
}
}
virtual bool HasConstructionPreview() const
bool HasConstructionPreview() const override
{
return m_ConstructionPreview;
}
virtual void Hotload(const VfsPath& name)
void Hotload(const VfsPath& name) override
{
if (!m_Unit)
return;

View File

@ -49,23 +49,23 @@ public:
return "<a:component type='system'/><empty/>";
}
virtual void Init(const CParamNode& UNUSED(paramNode))
void Init(const CParamNode& UNUSED(paramNode)) override
{
}
virtual void Deinit()
void Deinit() override
{
// Clear the map size & data.
if (CRenderer::IsInitialised())
g_Renderer.GetSceneRenderer().GetWaterManager().SetMapSize(0);
}
virtual void Serialize(ISerializer& serialize)
void Serialize(ISerializer& serialize) override
{
serialize.NumberFixed_Unbounded("height", m_WaterHeight);
}
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize)
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override
{
Init(paramNode);
@ -77,7 +77,7 @@ public:
RecomputeWaterData();
}
virtual void HandleMessage(const CMessage& msg, bool UNUSED(global))
void HandleMessage(const CMessage& msg, bool UNUSED(global)) override
{
switch (msg.GetType())
{
@ -101,7 +101,7 @@ public:
}
}
virtual void RecomputeWaterData()
void RecomputeWaterData() override
{
if (CRenderer::IsInitialised())
{
@ -113,7 +113,7 @@ public:
GetSimContext().GetTerrain().MakeDirty(RENDERDATA_UPDATE_VERTICES);
}
virtual void SetWaterLevel(entity_pos_t h)
void SetWaterLevel(entity_pos_t h) override
{
if (m_WaterHeight == h)
return;
@ -126,12 +126,12 @@ public:
GetSimContext().GetComponentManager().BroadcastMessage(msg);
}
virtual entity_pos_t GetWaterLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const
entity_pos_t GetWaterLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const override
{
return m_WaterHeight;
}
virtual float GetExactWaterLevel(float UNUSED(x), float UNUSED(z)) const
float GetExactWaterLevel(float UNUSED(x), float UNUSED(z)) const override
{
return m_WaterHeight.ToFloat();
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -30,11 +30,11 @@ class CCmpAIInterfaceScripted : public ICmpAIInterface
public:
DEFAULT_SCRIPT_WRAPPER(AIInterfaceScripted)
virtual void GetRepresentation(JS::MutableHandleValue ret)
void GetRepresentation(JS::MutableHandleValue ret) override
{
m_Script.CallRef("GetRepresentation", ret);
}
virtual void GetFullRepresentation(JS::MutableHandleValue ret, bool flushEvents = false)
void GetFullRepresentation(JS::MutableHandleValue ret, bool flushEvents = false) override
{
m_Script.CallRef("GetFullRepresentation", ret, flushEvents);
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2020 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -31,12 +31,12 @@ class CCmpAttackScripted : public ICmpAttack
public:
DEFAULT_SCRIPT_WRAPPER(AttackScripted)
virtual float GetRepeatTime(const std::string& type) const
float GetRepeatTime(const std::string& type) const override
{
return m_Script.Call<float, const std::string&>("GetRepeatTime", type);
}
virtual std::vector<CStr> GetAttackTypes() const
std::vector<CStr> GetAttackTypes() const override
{
return m_Script.Call<std::vector<CStr>>("GetAttackTypes");
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2015 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -30,22 +30,22 @@ class CCmpFoggingScripted : public ICmpFogging
public:
DEFAULT_SCRIPT_WRAPPER(FoggingScripted)
virtual bool IsActivated()
bool IsActivated() override
{
return m_Script.Call<bool>("IsActivated");
}
virtual bool WasSeen(player_id_t player)
bool WasSeen(player_id_t player) override
{
return m_Script.Call<bool>("WasSeen", player);
}
virtual bool IsMiraged(player_id_t player)
bool IsMiraged(player_id_t player) override
{
return m_Script.Call<bool>("IsMiraged", player);
}
virtual void ForceMiraging(player_id_t player)
void ForceMiraging(player_id_t player) override
{
return m_Script.CallVoid("ForceMiraging", player);
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -30,12 +30,12 @@ class CCmpGarrisonHolderScripted : public ICmpGarrisonHolder
public:
DEFAULT_SCRIPT_WRAPPER(GarrisonHolderScripted)
virtual std::vector<entity_id_t> GetEntities() const
std::vector<entity_id_t> GetEntities() const override
{
return m_Script.Call<std::vector<entity_id_t>>("GetEntities");
}
virtual void SetInitEntities(std::vector<entity_id_t>&& entities)
void SetInitEntities(std::vector<entity_id_t>&& entities) override
{
m_Script.CallVoid("SetInitGarrison", entities);
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -30,7 +30,7 @@ class CCmpGuiInterfaceScripted : public ICmpGuiInterface
public:
DEFAULT_SCRIPT_WRAPPER(GuiInterfaceScripted)
virtual void ScriptCall(int player, const std::wstring& cmd, JS::HandleValue data, JS::MutableHandleValue ret)
void ScriptCall(int player, const std::wstring& cmd, JS::HandleValue data, JS::MutableHandleValue ret) override
{
m_Script.CallRef("ScriptCall", ret, player, cmd, data);
}

View File

@ -31,17 +31,17 @@ class CCmpIdentityScripted : public ICmpIdentity
public:
DEFAULT_SCRIPT_WRAPPER(IdentityScripted)
virtual std::string GetSelectionGroupName()
std::string GetSelectionGroupName() override
{
return m_Script.Call<std::string>("GetSelectionGroupName");
}
virtual std::wstring GetPhenotype()
std::wstring GetPhenotype() override
{
return m_Script.Call<std::wstring>("GetPhenotype");
}
virtual std::wstring GetCiv()
std::wstring GetCiv() override
{
return m_Script.Call<std::wstring>("GetCiv");
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2014 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -30,7 +30,7 @@ class CCmpMirageScripted : public ICmpMirage
public:
DEFAULT_SCRIPT_WRAPPER(MirageScripted)
virtual player_id_t GetPlayer()
player_id_t GetPlayer() override
{
return m_Script.Call<player_id_t>("GetPlayer");
}

View File

@ -32,27 +32,27 @@ class CCmpPlayerScripted : public ICmpPlayer
public:
DEFAULT_SCRIPT_WRAPPER(PlayerScripted)
virtual CColor GetDisplayedColor()
CColor GetDisplayedColor() override
{
return m_Script.Call<CColor>("GetDisplayedColor");
}
virtual CFixedVector3D GetStartingCameraPos()
CFixedVector3D GetStartingCameraPos() override
{
return m_Script.Call<CFixedVector3D>("GetStartingCameraPos");
}
virtual CFixedVector3D GetStartingCameraRot()
CFixedVector3D GetStartingCameraRot() override
{
return m_Script.Call<CFixedVector3D>("GetStartingCameraRot");
}
virtual bool HasStartingCamera()
bool HasStartingCamera() override
{
return m_Script.Call<bool>("HasStartingCamera");
}
virtual std::string GetState()
std::string GetState() override
{
return m_Script.Call<std::string>("GetState");
}

View File

@ -30,12 +30,12 @@ class CCmpPlayerManagerScripted : public ICmpPlayerManager
public:
DEFAULT_SCRIPT_WRAPPER(PlayerManagerScripted)
virtual int32_t GetNumPlayers()
int32_t GetNumPlayers() override
{
return m_Script.Call<int32_t>("GetNumPlayers");
}
virtual entity_id_t GetPlayerByID(int32_t id)
entity_id_t GetPlayerByID(int32_t id) override
{
return m_Script.Call<entity_id_t>("GetPlayerByID", (int)id);
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2018 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -31,12 +31,12 @@ class CCmpRallyPointScripted : public ICmpRallyPoint
public:
DEFAULT_SCRIPT_WRAPPER(RallyPointScripted)
virtual bool HasPositions()
bool HasPositions() override
{
return m_Script.Call<bool>("HasPositions");
}
virtual CFixedVector2D GetFirstPosition()
CFixedVector2D GetFirstPosition() override
{
return m_Script.Call<CFixedVector2D>("GetFirstPosition");
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2018 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -30,7 +30,7 @@ class CCmpSoundScripted : public ICmpSound
public:
DEFAULT_SCRIPT_WRAPPER(SoundScripted)
virtual std::wstring GetSoundGroup(const std::wstring& soundName) const
std::wstring GetSoundGroup(const std::wstring& soundName) const override
{
return m_Script.Call<std::wstring>("GetSoundGroup", soundName);
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -30,7 +30,7 @@ class CCmpTerritoryDecayManagerScripted : public ICmpTerritoryDecayManager
public:
DEFAULT_SCRIPT_WRAPPER(TerritoryDecayManagerScripted)
virtual void SetBlinkingEntities()
void SetBlinkingEntities() override
{
return m_Script.CallVoid("SetBlinkingEntities");
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -34,7 +34,7 @@ public:
* @return - Correlation between garrisoned turrets (their ID) and which
* turret point they occupy (name).
*/
virtual std::vector<std::pair<std::string, entity_id_t> > GetTurrets() const
std::vector<std::pair<std::string, entity_id_t> > GetTurrets() const override
{
std::vector<std::pair<std::string, entity_id_t> > turrets;
std::vector<entity_id_t> entities = m_Script.Call<std::vector<entity_id_t>>("GetEntities");
@ -50,7 +50,7 @@ public:
/**
* Correlation between entities (ID) and the turret point they ought to occupy (name).
*/
virtual void SetInitEntities(std::vector<std::pair<std::string, entity_id_t>>&& entities)
void SetInitEntities(std::vector<std::pair<std::string, entity_id_t>>&& entities) override
{
for (const std::pair<std::string, entity_id_t>& p : entities)
m_Script.CallVoid("SetInitEntity", p.first, p.second);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -51,117 +51,117 @@ class CCmpUnitMotionScripted : public ICmpUnitMotion
public:
DEFAULT_SCRIPT_WRAPPER(UnitMotionScripted)
virtual bool MoveToPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange)
bool MoveToPointRange(entity_pos_t x, entity_pos_t z, entity_pos_t minRange, entity_pos_t maxRange) override
{
return m_Script.Call<bool>("MoveToPointRange", x, z, minRange, maxRange);
}
virtual bool MoveToTargetRange(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange)
bool MoveToTargetRange(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) override
{
return m_Script.Call<bool>("MoveToTargetRange", target, minRange, maxRange);
}
virtual void MoveToFormationOffset(entity_id_t target, entity_pos_t x, entity_pos_t z)
void MoveToFormationOffset(entity_id_t target, entity_pos_t x, entity_pos_t z) override
{
m_Script.CallVoid("MoveToFormationOffset", target, x, z);
}
virtual void SetMemberOfFormation(entity_id_t controller)
void SetMemberOfFormation(entity_id_t controller) override
{
m_Script.CallVoid("SetMemberOfFormation", controller);
}
virtual bool IsTargetRangeReachable(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange)
bool IsTargetRangeReachable(entity_id_t target, entity_pos_t minRange, entity_pos_t maxRange) override
{
return m_Script.Call<bool>("IsTargetRangeReachable", target, minRange, maxRange);
}
virtual void FaceTowardsPoint(entity_pos_t x, entity_pos_t z)
void FaceTowardsPoint(entity_pos_t x, entity_pos_t z) override
{
m_Script.CallVoid("FaceTowardsPoint", x, z);
}
virtual void StopMoving()
void StopMoving() override
{
m_Script.CallVoid("StopMoving");
}
virtual fixed GetCurrentSpeed() const
fixed GetCurrentSpeed() const override
{
return m_Script.Call<fixed>("GetCurrentSpeed");
}
virtual bool IsMoveRequested() const
bool IsMoveRequested() const override
{
return m_Script.Call<bool>("IsMoveRequested");
}
virtual fixed GetSpeed() const
fixed GetSpeed() const override
{
return m_Script.Call<fixed>("GetSpeed");
}
virtual fixed GetWalkSpeed() const
fixed GetWalkSpeed() const override
{
return m_Script.Call<fixed>("GetWalkSpeed");
}
virtual fixed GetRunMultiplier() const
fixed GetRunMultiplier() const override
{
return m_Script.Call<fixed>("GetRunMultiplier");
}
virtual void SetSpeedMultiplier(fixed multiplier)
void SetSpeedMultiplier(fixed multiplier) override
{
m_Script.CallVoid("SetSpeedMultiplier", multiplier);
}
virtual fixed GetSpeedMultiplier() const
fixed GetSpeedMultiplier() const override
{
return m_Script.Call<fixed>("GetSpeedMultiplier");
}
virtual CFixedVector2D EstimateFuturePosition(const fixed dt) const
CFixedVector2D EstimateFuturePosition(const fixed dt) const override
{
return m_Script.Call<CFixedVector2D>("EstimateFuturePosition", dt);
}
virtual fixed GetAcceleration() const
fixed GetAcceleration() const override
{
return m_Script.Call<fixed>("GetAcceleration");
}
virtual void SetAcceleration(fixed acceleration)
void SetAcceleration(fixed acceleration) override
{
m_Script.CallVoid("SetAcceleration", acceleration);
}
virtual void SetFacePointAfterMove(bool facePointAfterMove)
void SetFacePointAfterMove(bool facePointAfterMove) override
{
m_Script.CallVoid("SetFacePointAfterMove", facePointAfterMove);
}
virtual bool GetFacePointAfterMove() const
bool GetFacePointAfterMove() const override
{
return m_Script.Call<bool>("GetFacePointAfterMove");
}
virtual pass_class_t GetPassabilityClass() const
pass_class_t GetPassabilityClass() const override
{
return m_Script.Call<pass_class_t>("GetPassabilityClass");
}
virtual std::string GetPassabilityClassName() const
std::string GetPassabilityClassName() const override
{
return m_Script.Call<std::string>("GetPassabilityClassName");
}
virtual entity_pos_t GetUnitClearance() const
entity_pos_t GetUnitClearance() const override
{
return m_Script.Call<entity_pos_t>("GetUnitClearance");
}
virtual void SetDebugOverlay(bool enabled)
void SetDebugOverlay(bool enabled) override
{
m_Script.CallVoid("SetDebugOverlay", enabled);
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2020 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -30,27 +30,27 @@ class CCmpValueModificationManagerScripted : public ICmpValueModificationManager
public:
DEFAULT_SCRIPT_WRAPPER(ValueModificationManagerScripted)
virtual fixed ApplyModifications(std::wstring valueName, fixed currentValue, entity_id_t entity) const
fixed ApplyModifications(std::wstring valueName, fixed currentValue, entity_id_t entity) const override
{
return m_Script.Call<fixed>("ApplyModifications", valueName, currentValue, entity);
}
virtual u32 ApplyModifications(std::wstring valueName, u32 currentValue, entity_id_t entity) const
u32 ApplyModifications(std::wstring valueName, u32 currentValue, entity_id_t entity) const override
{
return m_Script.Call<u32>("ApplyModifications", valueName, currentValue, entity);
}
virtual u16 ApplyModifications(std::wstring valueName, u16 currentValue, entity_id_t entity) const
u16 ApplyModifications(std::wstring valueName, u16 currentValue, entity_id_t entity) const override
{
return m_Script.Call<u16>("ApplyModifications", valueName, currentValue, entity);
}
virtual std::wstring ApplyModifications(std::wstring valueName, std::wstring currentValue, entity_id_t entity) const
std::wstring ApplyModifications(std::wstring valueName, std::wstring currentValue, entity_id_t entity) const override
{
return m_Script.Call<std::wstring>("ApplyModifications", valueName, currentValue, entity);
}
virtual bool ApplyModifications(std::wstring valueName, bool currentValue, entity_id_t entity) const
bool ApplyModifications(std::wstring valueName, bool currentValue, entity_id_t entity) const override
{
return m_Script.Call<bool>("ApplyModifications", valueName, currentValue, entity);
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2020 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -30,12 +30,12 @@ class CCmpVisibilityScripted : public ICmpVisibility
public:
DEFAULT_SCRIPT_WRAPPER(VisibilityScripted)
virtual bool IsActivated()
bool IsActivated() override
{
return m_Script.Call<bool>("IsActivated");
}
virtual LosVisibility GetVisibility(player_id_t player, bool isVisible, bool isExplored)
LosVisibility GetVisibility(player_id_t player, bool isVisible, bool isExplored) override
{
int visibility = m_Script.Call<int, player_id_t, bool, bool>("GetVisibility", player, isVisible, isExplored);
@ -53,12 +53,12 @@ public:
}
}
virtual bool GetRetainInFog()
bool GetRetainInFog() override
{
return m_Script.Call<bool>("GetRetainInFog");
}
virtual bool GetAlwaysVisible()
bool GetAlwaysVisible() override
{
return m_Script.Call<bool>("GetAlwaysVisible");
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -26,32 +26,32 @@ public:
DEFAULT_MOCK_COMPONENT()
ICmpObstructionManager::ObstructionSquare obstruction;
virtual ICmpObstructionManager::tag_t GetObstruction() const { return ICmpObstructionManager::tag_t(); }
virtual bool GetObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const { out = obstruction; return true; }
virtual bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare& UNUSED(out)) const { return true; }
virtual entity_pos_t GetSize() const { return entity_pos_t::Zero(); }
virtual CFixedVector2D GetStaticSize() const { return CFixedVector2D(); }
virtual EObstructionType GetObstructionType() const { return ICmpObstruction::STATIC; }
virtual void SetUnitClearance(const entity_pos_t& UNUSED(clearance)) { }
virtual bool IsControlPersistent() const { return true; }
virtual bool CheckShorePlacement() const { return true; }
virtual EFoundationCheck CheckFoundation(const std::string& UNUSED(className)) const { return EFoundationCheck(); }
virtual EFoundationCheck CheckFoundation(const std::string& UNUSED(className), bool UNUSED(onlyCenterPoint)) const { return EFoundationCheck(); }
virtual std::string CheckFoundation_wrapper(const std::string& UNUSED(className), bool UNUSED(onlyCenterPoint)) const { return std::string(); }
virtual bool CheckDuplicateFoundation() const { return true; }
virtual std::vector<entity_id_t> GetEntitiesByFlags(ICmpObstructionManager::flags_t UNUSED(flags)) const { return std::vector<entity_id_t>(); }
virtual std::vector<entity_id_t> GetEntitiesBlockingMovement() const { return std::vector<entity_id_t>(); }
virtual std::vector<entity_id_t> GetEntitiesBlockingConstruction() const { return std::vector<entity_id_t>(); }
virtual std::vector<entity_id_t> GetEntitiesDeletedUponConstruction() const { return std::vector<entity_id_t>(); }
virtual void ResolveFoundationCollisions() const { }
virtual void SetActive(bool UNUSED(active)) { }
virtual void SetMovingFlag(bool UNUSED(enabled)) { }
virtual void SetDisableBlockMovementPathfinding(bool UNUSED(movementDisabled), bool UNUSED(pathfindingDisabled), int32_t UNUSED(shape)) { }
virtual bool GetBlockMovementFlag(bool) const { return true; }
virtual void SetControlGroup(entity_id_t UNUSED(group)) { }
virtual entity_id_t GetControlGroup() const { return INVALID_ENTITY; }
virtual void SetControlGroup2(entity_id_t UNUSED(group2)) { }
virtual entity_id_t GetControlGroup2() const { return INVALID_ENTITY; }
ICmpObstructionManager::tag_t GetObstruction() const override { return ICmpObstructionManager::tag_t(); }
bool GetObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const override { out = obstruction; return true; }
bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare& UNUSED(out)) const override { return true; }
entity_pos_t GetSize() const override { return entity_pos_t::Zero(); }
CFixedVector2D GetStaticSize() const override { return CFixedVector2D(); }
EObstructionType GetObstructionType() const override { return ICmpObstruction::STATIC; }
void SetUnitClearance(const entity_pos_t& UNUSED(clearance)) override { }
bool IsControlPersistent() const override { return true; }
bool CheckShorePlacement() const override { return true; }
EFoundationCheck CheckFoundation(const std::string& UNUSED(className)) const override { return EFoundationCheck(); }
EFoundationCheck CheckFoundation(const std::string& UNUSED(className), bool UNUSED(onlyCenterPoint)) const override { return EFoundationCheck(); }
std::string CheckFoundation_wrapper(const std::string& UNUSED(className), bool UNUSED(onlyCenterPoint)) const override { return std::string(); }
bool CheckDuplicateFoundation() const override { return true; }
std::vector<entity_id_t> GetEntitiesByFlags(ICmpObstructionManager::flags_t UNUSED(flags)) const override { return std::vector<entity_id_t>(); }
std::vector<entity_id_t> GetEntitiesBlockingMovement() const override { return std::vector<entity_id_t>(); }
std::vector<entity_id_t> GetEntitiesBlockingConstruction() const override { return std::vector<entity_id_t>(); }
std::vector<entity_id_t> GetEntitiesDeletedUponConstruction() const override { return std::vector<entity_id_t>(); }
void ResolveFoundationCollisions() const override { }
void SetActive(bool UNUSED(active)) override { }
void SetMovingFlag(bool UNUSED(enabled)) override { }
void SetDisableBlockMovementPathfinding(bool UNUSED(movementDisabled), bool UNUSED(pathfindingDisabled), int32_t UNUSED(shape)) override { }
bool GetBlockMovementFlag(bool) const override { return true; }
void SetControlGroup(entity_id_t UNUSED(group)) override { }
entity_id_t GetControlGroup() const override { return INVALID_ENTITY; }
void SetControlGroup2(entity_id_t UNUSED(group2)) override { }
entity_id_t GetControlGroup2() const override { return INVALID_ENTITY; }
};
class TestCmpObstructionManager : public CxxTest::TestSuite

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -26,21 +26,21 @@ class MockWater : public ICmpWaterManager
public:
DEFAULT_MOCK_COMPONENT()
virtual entity_pos_t GetWaterLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const
entity_pos_t GetWaterLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const override
{
return entity_pos_t::FromInt(100);
}
virtual float GetExactWaterLevel(float UNUSED(x), float UNUSED(z)) const
float GetExactWaterLevel(float UNUSED(x), float UNUSED(z)) const override
{
return 100.f;
}
virtual void RecomputeWaterData()
void RecomputeWaterData() override
{
}
virtual void SetWaterLevel(entity_pos_t UNUSED(h))
void SetWaterLevel(entity_pos_t UNUSED(h)) override
{
}
};

View File

@ -30,8 +30,8 @@ class MockVisionRgm : public ICmpVision
public:
DEFAULT_MOCK_COMPONENT()
virtual entity_pos_t GetRange() const { return entity_pos_t::FromInt(66); }
virtual bool GetRevealShore() const { return false; }
entity_pos_t GetRange() const override { return entity_pos_t::FromInt(66); }
bool GetRevealShore() const override { return false; }
};
class MockPositionRgm : public ICmpPosition
@ -39,38 +39,38 @@ class MockPositionRgm : public ICmpPosition
public:
DEFAULT_MOCK_COMPONENT()
virtual void SetTurretParent(entity_id_t UNUSED(id), const CFixedVector3D& UNUSED(pos)) {}
virtual entity_id_t GetTurretParent() const {return INVALID_ENTITY;}
virtual void UpdateTurretPosition() {}
virtual std::set<entity_id_t>* GetTurrets() { return NULL; }
virtual bool IsInWorld() const { return true; }
virtual void MoveOutOfWorld() { }
virtual void MoveTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) { }
virtual void MoveAndTurnTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z), entity_angle_t UNUSED(a)) { }
virtual void JumpTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) { }
virtual void SetHeightOffset(entity_pos_t UNUSED(dy)) { }
virtual entity_pos_t GetHeightOffset() const { return entity_pos_t::Zero(); }
virtual void SetHeightFixed(entity_pos_t UNUSED(y)) { }
virtual entity_pos_t GetHeightFixed() const { return entity_pos_t::Zero(); }
virtual entity_pos_t GetHeightAtFixed(entity_pos_t, entity_pos_t) const { return entity_pos_t::Zero(); }
virtual bool IsHeightRelative() const { return true; }
virtual void SetHeightRelative(bool UNUSED(relative)) { }
virtual bool CanFloat() const { return false; }
virtual void SetFloating(bool UNUSED(flag)) { }
virtual void SetActorFloating(bool UNUSED(flag)) { }
virtual void SetConstructionProgress(fixed UNUSED(progress)) { }
virtual CFixedVector3D GetPosition() const { return m_Pos; }
virtual CFixedVector2D GetPosition2D() const { return CFixedVector2D(m_Pos.X, m_Pos.Z); }
virtual CFixedVector3D GetPreviousPosition() const { return CFixedVector3D(); }
virtual CFixedVector2D GetPreviousPosition2D() const { return CFixedVector2D(); }
virtual fixed GetTurnRate() const { return fixed::Zero(); }
virtual void TurnTo(entity_angle_t UNUSED(y)) { }
virtual void SetYRotation(entity_angle_t UNUSED(y)) { }
virtual void SetXZRotation(entity_angle_t UNUSED(x), entity_angle_t UNUSED(z)) { }
virtual CFixedVector3D GetRotation() const { return CFixedVector3D(); }
virtual fixed GetDistanceTravelled() const { return fixed::Zero(); }
virtual void GetInterpolatedPosition2D(float UNUSED(frameOffset), float& x, float& z, float& rotY) const { x = z = rotY = 0; }
virtual CMatrix3D GetInterpolatedTransform(float UNUSED(frameOffset)) const { return CMatrix3D(); }
void SetTurretParent(entity_id_t UNUSED(id), const CFixedVector3D& UNUSED(pos)) override {}
entity_id_t GetTurretParent() const override {return INVALID_ENTITY;}
void UpdateTurretPosition() override {}
std::set<entity_id_t>* GetTurrets() override { return nullptr; }
bool IsInWorld() const override { return true; }
void MoveOutOfWorld() override { }
void MoveTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) override { }
void MoveAndTurnTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z), entity_angle_t UNUSED(a)) override { }
void JumpTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) override { }
void SetHeightOffset(entity_pos_t UNUSED(dy)) override { }
entity_pos_t GetHeightOffset() const override { return entity_pos_t::Zero(); }
void SetHeightFixed(entity_pos_t UNUSED(y)) override { }
entity_pos_t GetHeightFixed() const override { return entity_pos_t::Zero(); }
entity_pos_t GetHeightAtFixed(entity_pos_t, entity_pos_t) const override { return entity_pos_t::Zero(); }
bool IsHeightRelative() const override { return true; }
void SetHeightRelative(bool UNUSED(relative)) override { }
bool CanFloat() const override { return false; }
void SetFloating(bool UNUSED(flag)) override { }
void SetActorFloating(bool UNUSED(flag)) override { }
void SetConstructionProgress(fixed UNUSED(progress)) override { }
CFixedVector3D GetPosition() const override { return m_Pos; }
CFixedVector2D GetPosition2D() const override { return CFixedVector2D(m_Pos.X, m_Pos.Z); }
CFixedVector3D GetPreviousPosition() const override { return CFixedVector3D(); }
CFixedVector2D GetPreviousPosition2D() const override { return CFixedVector2D(); }
fixed GetTurnRate() const override { return fixed::Zero(); }
void TurnTo(entity_angle_t UNUSED(y)) override { }
void SetYRotation(entity_angle_t UNUSED(y)) override { }
void SetXZRotation(entity_angle_t UNUSED(x), entity_angle_t UNUSED(z)) override { }
CFixedVector3D GetRotation() const override { return CFixedVector3D(); }
fixed GetDistanceTravelled() const override { return fixed::Zero(); }
void GetInterpolatedPosition2D(float UNUSED(frameOffset), float& x, float& z, float& rotY) const override { x = z = rotY = 0; }
CMatrix3D GetInterpolatedTransform(float UNUSED(frameOffset)) const override { return CMatrix3D(); }
CFixedVector3D m_Pos;
};
@ -82,32 +82,32 @@ public:
MockObstructionRgm(entity_pos_t s) : m_Size(s) {};
virtual ICmpObstructionManager::tag_t GetObstruction() const { return {}; };
virtual bool GetObstructionSquare(ICmpObstructionManager::ObstructionSquare&) const { return false; };
virtual bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare&) const { return false; };
virtual entity_pos_t GetSize() const { return m_Size; };
virtual CFixedVector2D GetStaticSize() const { return {}; };
virtual EObstructionType GetObstructionType() const { return {}; };
virtual void SetUnitClearance(const entity_pos_t&) {};
virtual bool IsControlPersistent() const { return {}; };
virtual bool CheckShorePlacement() const { return {}; };
virtual EFoundationCheck CheckFoundation(const std::string&) const { return {}; };
virtual EFoundationCheck CheckFoundation(const std::string& , bool) const { return {}; };
virtual std::string CheckFoundation_wrapper(const std::string&, bool) const { return {}; };
virtual bool CheckDuplicateFoundation() const { return {}; };
virtual std::vector<entity_id_t> GetEntitiesByFlags(ICmpObstructionManager::flags_t) const { return {}; };
virtual std::vector<entity_id_t> GetEntitiesBlockingMovement() const { return {}; };
virtual std::vector<entity_id_t> GetEntitiesBlockingConstruction() const { return {}; };
virtual std::vector<entity_id_t> GetEntitiesDeletedUponConstruction() const { return {}; };
virtual void ResolveFoundationCollisions() const {};
virtual void SetActive(bool) {};
virtual void SetMovingFlag(bool) {};
virtual void SetDisableBlockMovementPathfinding(bool, bool, int32_t) {};
virtual bool GetBlockMovementFlag(bool) const { return {}; };
virtual void SetControlGroup(entity_id_t) {};
virtual entity_id_t GetControlGroup() const { return {}; };
virtual void SetControlGroup2(entity_id_t) {};
virtual entity_id_t GetControlGroup2() const { return {}; };
ICmpObstructionManager::tag_t GetObstruction() const override { return {}; };
bool GetObstructionSquare(ICmpObstructionManager::ObstructionSquare&) const override { return false; };
bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare&) const override { return false; };
entity_pos_t GetSize() const override { return m_Size; };
CFixedVector2D GetStaticSize() const override { return {}; };
EObstructionType GetObstructionType() const override { return {}; };
void SetUnitClearance(const entity_pos_t&) override {};
bool IsControlPersistent() const override { return {}; };
bool CheckShorePlacement() const override { return {}; };
EFoundationCheck CheckFoundation(const std::string&) const override { return {}; };
EFoundationCheck CheckFoundation(const std::string& , bool) const override { return {}; };
std::string CheckFoundation_wrapper(const std::string&, bool) const override { return {}; };
bool CheckDuplicateFoundation() const override { return {}; };
std::vector<entity_id_t> GetEntitiesByFlags(ICmpObstructionManager::flags_t) const override { return {}; };
std::vector<entity_id_t> GetEntitiesBlockingMovement() const override { return {}; };
std::vector<entity_id_t> GetEntitiesBlockingConstruction() const override { return {}; };
std::vector<entity_id_t> GetEntitiesDeletedUponConstruction() const override { return {}; };
void ResolveFoundationCollisions() const override {};
void SetActive(bool) override {};
void SetMovingFlag(bool) override {};
void SetDisableBlockMovementPathfinding(bool, bool, int32_t) override {};
bool GetBlockMovementFlag(bool) const override { return {}; };
void SetControlGroup(entity_id_t) override {};
entity_id_t GetControlGroup() const override { return {}; };
void SetControlGroup2(entity_id_t) override {};
entity_id_t GetControlGroup2() const override { return {}; };
private:
entity_pos_t m_Size;
};

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -102,31 +102,31 @@ private:
{ \
return "<a:component type='script-wrapper'/><empty/>"; \
} \
virtual void Init(const CParamNode& paramNode) \
void Init(const CParamNode& paramNode) override \
{ \
m_Script.Init(paramNode, GetEntityId()); \
} \
virtual void Deinit() \
void Deinit() override \
{ \
m_Script.Deinit(); \
} \
virtual void HandleMessage(const CMessage& msg, bool global) \
void HandleMessage(const CMessage& msg, bool global) override \
{ \
m_Script.HandleMessage(msg, global); \
} \
virtual void Serialize(ISerializer& serialize) \
void Serialize(ISerializer& serialize) override \
{ \
m_Script.Serialize(serialize); \
} \
virtual void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) \
void Deserialize(const CParamNode& paramNode, IDeserializer& deserialize) override \
{ \
m_Script.Deserialize(paramNode, deserialize, GetEntityId()); \
} \
virtual JS::Value GetJSInstance() const \
JS::Value GetJSInstance() const override \
{ \
return m_Script.GetInstance(); \
} \
virtual int GetComponentTypeId() const \
int GetComponentTypeId() const override \
{ \
return CID_##cname; \
} \

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -39,26 +39,26 @@
#define DEFAULT_COMPONENT_ALLOCATOR(cname) \
static IComponent* Allocate(const ScriptInterface&, JS::HandleValue) { return new CCmp##cname(); } \
static void Deallocate(IComponent* cmp) { delete static_cast<CCmp##cname*> (cmp); } \
virtual int GetComponentTypeId() const \
int GetComponentTypeId() const override \
{ \
return CID_##cname; \
}
#define DEFAULT_MOCK_COMPONENT() \
virtual int GetComponentTypeId() const \
int GetComponentTypeId() const override \
{ \
return -1; \
} \
virtual void Init(const CParamNode& UNUSED(paramNode)) \
void Init(const CParamNode& UNUSED(paramNode)) override \
{ \
} \
virtual void Deinit() \
void Deinit() override \
{ \
} \
virtual void Serialize(ISerializer& UNUSED(serialize)) \
void Serialize(ISerializer& UNUSED(serialize)) override \
{ \
} \
virtual void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& UNUSED(deserialize)) \
void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& UNUSED(deserialize)) override \
{ \
} \

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2021 Wildfire Games.
/* Copyright (C) 2022 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -193,56 +193,56 @@ class MockTerrain : public ICmpTerrain
public:
DEFAULT_MOCK_COMPONENT()
virtual bool IsLoaded() const
bool IsLoaded() const override
{
return true;
}
virtual CFixedVector3D CalcNormal(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const
CFixedVector3D CalcNormal(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const override
{
return CFixedVector3D(fixed::FromInt(0), fixed::FromInt(1), fixed::FromInt(0));
}
virtual CVector3D CalcExactNormal(float UNUSED(x), float UNUSED(z)) const
CVector3D CalcExactNormal(float UNUSED(x), float UNUSED(z)) const override
{
return CVector3D(0.f, 1.f, 0.f);
}
virtual entity_pos_t GetGroundLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const
entity_pos_t GetGroundLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const override
{
return entity_pos_t::FromInt(50);
}
virtual float GetExactGroundLevel(float UNUSED(x), float UNUSED(z)) const
float GetExactGroundLevel(float UNUSED(x), float UNUSED(z)) const override
{
return 50.f;
}
virtual u16 GetTilesPerSide() const
u16 GetTilesPerSide() const override
{
return 16;
}
virtual u32 GetMapSize() const
u32 GetMapSize() const override
{
return GetTilesPerSide() * TERRAIN_TILE_SIZE;
}
virtual u16 GetVerticesPerSide() const
u16 GetVerticesPerSide() const override
{
return 17;
}
virtual CTerrain* GetCTerrain()
CTerrain* GetCTerrain() override
{
return NULL;
return nullptr;
}
virtual void MakeDirty(i32 UNUSED(i0), i32 UNUSED(j0), i32 UNUSED(i1), i32 UNUSED(j1))
void MakeDirty(i32 UNUSED(i0), i32 UNUSED(j0), i32 UNUSED(i1), i32 UNUSED(j1)) override
{
}
virtual void ReloadTerrain(bool UNUSED(ReloadWater))
void ReloadTerrain(bool UNUSED(ReloadWater)) override
{
}
};