Mark several classes as final for devirtualization performance benefits.
continuous-integration/drone/push Build is passing Details

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
Deukhoofd 2020-10-15 18:21:50 +02:00
parent b006344d83
commit de8b5de7b4
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
12 changed files with 13 additions and 13 deletions

View File

@ -4,7 +4,7 @@
#include "EventData.hpp" #include "EventData.hpp"
namespace CreatureLib::Battling { namespace CreatureLib::Battling {
class AttackUseEvent : public EventData { class AttackUseEvent final : public EventData {
ArbUt::BorrowedPtr<ExecutingAttack> _attack; ArbUt::BorrowedPtr<ExecutingAttack> _attack;
public: public:

View File

@ -3,7 +3,7 @@
#include "EventData.hpp" #include "EventData.hpp"
namespace CreatureLib::Battling { namespace CreatureLib::Battling {
class ChangeSpeciesEvent : public EventData { class ChangeSpeciesEvent final : public EventData {
const ArbUt::BorrowedPtr<Creature> _creature; const ArbUt::BorrowedPtr<Creature> _creature;
const ArbUt::BorrowedPtr<const CreatureLib::Library::CreatureSpecies> _newSpecies; const ArbUt::BorrowedPtr<const CreatureLib::Library::CreatureSpecies> _newSpecies;

View File

@ -3,7 +3,7 @@
#include "EventData.hpp" #include "EventData.hpp"
namespace CreatureLib::Battling { namespace CreatureLib::Battling {
class ChangeVariantEvent : public EventData { class ChangeVariantEvent final : public EventData {
const ArbUt::BorrowedPtr<Creature> _creature; const ArbUt::BorrowedPtr<Creature> _creature;
const ArbUt::BorrowedPtr<const CreatureLib::Library::SpeciesVariant> _newVariant; const ArbUt::BorrowedPtr<const CreatureLib::Library::SpeciesVariant> _newVariant;

View File

@ -3,7 +3,7 @@
#include "EventData.hpp" #include "EventData.hpp"
namespace CreatureLib::Battling { namespace CreatureLib::Battling {
class DamageEvent : public EventData { class DamageEvent final : public EventData {
ArbUt::BorrowedPtr<Creature> _creature; ArbUt::BorrowedPtr<Creature> _creature;
DamageSource _damageSource; DamageSource _damageSource;
uint32_t _originalHealth; uint32_t _originalHealth;

View File

@ -3,7 +3,7 @@
#include "EventData.hpp" #include "EventData.hpp"
namespace CreatureLib::Battling { namespace CreatureLib::Battling {
class DisplayTextEvent : public EventData { class DisplayTextEvent final : public EventData {
const ArbUt::StringView _text; const ArbUt::StringView _text;
public: public:

View File

@ -3,7 +3,7 @@
#include "EventData.hpp" #include "EventData.hpp"
namespace CreatureLib::Battling { namespace CreatureLib::Battling {
class ExperienceGainEvent : public EventData { class ExperienceGainEvent final : public EventData {
ArbUt::BorrowedPtr<Creature> _creature; ArbUt::BorrowedPtr<Creature> _creature;
uint32_t _previousExperience; uint32_t _previousExperience;
uint32_t _newExperience; uint32_t _newExperience;

View File

@ -3,7 +3,7 @@
#include "EventData.hpp" #include "EventData.hpp"
namespace CreatureLib::Battling { namespace CreatureLib::Battling {
class FaintEvent : public EventData { class FaintEvent final : public EventData {
ArbUt::BorrowedPtr<Creature> _creature; ArbUt::BorrowedPtr<Creature> _creature;
public: public:

View File

@ -3,7 +3,7 @@
#include "EventData.hpp" #include "EventData.hpp"
namespace CreatureLib::Battling { namespace CreatureLib::Battling {
class HealEvent : public EventData { class HealEvent final : public EventData {
ArbUt::BorrowedPtr<Creature> _creature; ArbUt::BorrowedPtr<Creature> _creature;
uint32_t _originalHealth; uint32_t _originalHealth;
uint32_t _newHealth; uint32_t _newHealth;

View File

@ -3,7 +3,7 @@
#include "EventData.hpp" #include "EventData.hpp"
namespace CreatureLib::Battling { namespace CreatureLib::Battling {
class MissEvent : public EventData { class MissEvent final : public EventData {
ArbUt::BorrowedPtr<Creature> _creature; ArbUt::BorrowedPtr<Creature> _creature;
public: public:

View File

@ -4,7 +4,7 @@
#include "EventData.hpp" #include "EventData.hpp"
namespace CreatureLib::Battling { namespace CreatureLib::Battling {
class SwitchEvent : public EventData { class SwitchEvent final : public EventData {
CreatureIndex _index; CreatureIndex _index;
ArbUt::BorrowedPtr<Creature> _newCreature; ArbUt::BorrowedPtr<Creature> _newCreature;

View File

@ -3,13 +3,13 @@
#include "EventData.hpp" #include "EventData.hpp"
namespace CreatureLib::Battling { namespace CreatureLib::Battling {
class TurnStartEvent : public EventData { class TurnStartEvent final : public EventData {
public: public:
TurnStartEvent() {} TurnStartEvent() {}
EventDataKind GetKind() const noexcept override { return EventDataKind ::TurnStart; } EventDataKind GetKind() const noexcept override { return EventDataKind ::TurnStart; }
}; };
class TurnEndEvent : public EventData { class TurnEndEvent final : public EventData {
public: public:
TurnEndEvent() {} TurnEndEvent() {}
EventDataKind GetKind() const noexcept override { return EventDataKind ::TurnEnd; } EventDataKind GetKind() const noexcept override { return EventDataKind ::TurnEnd; }

View File

@ -4,7 +4,7 @@
#include "HistoryElement.hpp" #include "HistoryElement.hpp"
namespace CreatureLib::Battling { namespace CreatureLib::Battling {
class AttackUseHistory : public HistoryElement { class AttackUseHistory final : public HistoryElement {
std::unique_ptr<const ExecutingAttack> _attack; std::unique_ptr<const ExecutingAttack> _attack;
protected: protected: