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

This commit is contained in:
Deukhoofd 2020-10-15 18:13:00 +02:00
parent f816975b63
commit fff926b617
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
20 changed files with 20 additions and 20 deletions

View File

@ -6,7 +6,7 @@
#include "PkmnEventKind.hpp"
namespace PkmnLib::Battling {
class StatusChangeEvent : public CreatureLib::Battling::EventData {
class StatusChangeEvent final : public CreatureLib::Battling::EventData {
ArbUt::BorrowedPtr<Pokemon> _pokemon;
ArbUt::StringView _statusName;

View File

@ -4,7 +4,7 @@
#include "PkmnEventKind.hpp"
namespace PkmnLib::Battling {
class WeatherChangeEvent : public CreatureLib::Battling::EventData {
class WeatherChangeEvent final : public CreatureLib::Battling::EventData {
ArbUt::StringView _weatherName;
public:

View File

@ -9,7 +9,7 @@
#include "StatCalculator.hpp"
namespace PkmnLib::Battling {
class BattleLibrary : public CreatureLib::Battling::BattleLibrary {
class BattleLibrary final : public CreatureLib::Battling::BattleLibrary {
public:
BattleLibrary(Library::PokemonLibrary* staticLib, StatCalculator* statCalculator, DamageLibrary* damageLibrary,
PkmnLib::Battling::ExperienceLibrary* experienceLibrary,

View File

@ -3,7 +3,7 @@
#include <CreatureLib/Battling/Library/DamageLibrary.hpp>
namespace PkmnLib::Battling {
class DamageLibrary : public CreatureLib::Battling::DamageLibrary {
class DamageLibrary final : public CreatureLib::Battling::DamageLibrary {
public:
uint32_t GetDamage(CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
uint8_t hitIndex,

View File

@ -5,7 +5,7 @@
#include <CreatureLib/Defines.hpp>
namespace PkmnLib::Battling {
class ExperienceLibrary : public CreatureLib::Battling::ExperienceLibrary {
class ExperienceLibrary final : public CreatureLib::Battling::ExperienceLibrary {
public:
void HandleExperienceGain(
CreatureLib::Battling::Creature* faintedMon,

View File

@ -6,7 +6,7 @@
#include "../Pokemon/LearnedMove.hpp"
namespace PkmnLib::Battling {
class MiscLibrary : public CreatureLib::Battling::MiscLibrary {
class MiscLibrary final : public CreatureLib::Battling::MiscLibrary {
std::unique_ptr<const PkmnLib::Library::MoveData> _struggleData = std::make_unique<PkmnLib::Library::MoveData>(
"struggle"_cnc, 0, PkmnLib::Library::MoveCategory::Physical, 50, 255, 10,
CreatureLib::Library::AttackTarget::Any, 0,

View File

@ -7,7 +7,7 @@
namespace PkmnLib::Battling {
class Pokemon;
class StatCalculator : public CreatureLib::Battling::BattleStatCalculator {
class StatCalculator final : public CreatureLib::Battling::BattleStatCalculator {
protected:
virtual uint32_t CalculateHealthStat(const Pokemon* pkmn) const;
virtual uint32_t CalculateOtherStat(const Pokemon* pkmn, CreatureLib::Library::Statistic stat) const;

View File

@ -4,7 +4,7 @@
#include <CreatureLib/Battling/Models/LearnedAttack.hpp>
#include "../../Library/Moves/MoveData.hpp"
namespace PkmnLib::Battling {
class LearnedMove : public CreatureLib::Battling::LearnedAttack {
class LearnedMove final : public CreatureLib::Battling::LearnedAttack {
public:
LearnedMove(const ArbUt::BorrowedPtr<const Library::MoveData>& move,
CreatureLib::Battling::AttackLearnMethod learnMethod)

View File

@ -3,7 +3,7 @@
#include <CreatureLib/Library/Items/Item.hpp>
namespace PkmnLib::Library {
class Item : public CreatureLib::Library::Item {
class Item final : public CreatureLib::Library::Item {
uint8_t _flingPower;
public:

View File

@ -4,7 +4,7 @@
#include <CreatureLib/Library/ItemLibrary.hpp>
#include "Item.hpp"
namespace PkmnLib::Library {
class ItemLibrary : public CreatureLib::Library::ItemLibrary {
class ItemLibrary final : public CreatureLib::Library::ItemLibrary {
public:
inline bool TryGet(const ArbUt::BasicStringView& name, ArbUt::BorrowedPtr<const Item>& item) const {
auto v = item.As<const CreatureLib::Library::Item>();

View File

@ -4,7 +4,7 @@
#include <CreatureLib/Library/LibrarySettings.hpp>
namespace PkmnLib::Library {
class LibrarySettings : public CreatureLib::Library::LibrarySettings {
class LibrarySettings final : public CreatureLib::Library::LibrarySettings {
uint16_t _shinyRate;
public:

View File

@ -5,7 +5,7 @@
#include "MoveCategory.hpp"
namespace PkmnLib::Library {
class MoveData : public CreatureLib::Library::AttackData {
class MoveData final : public CreatureLib::Library::AttackData {
private:
public:
MoveData(const ArbUt::StringView& name, uint8_t type, PkmnLib::Library::MoveCategory category, uint8_t power,

View File

@ -4,7 +4,7 @@
#include <CreatureLib/Library/AttackLibrary.hpp>
#include "MoveData.hpp"
namespace PkmnLib::Library {
class MoveLibrary : public CreatureLib::Library::AttackLibrary {
class MoveLibrary final : public CreatureLib::Library::AttackLibrary {
public:
MoveLibrary(size_t initialCapacity = 32) : CreatureLib::Library::AttackLibrary(initialCapacity) {}

View File

@ -9,7 +9,7 @@
#include "Species/SpeciesLibrary.hpp"
namespace PkmnLib::Library {
class PokemonLibrary : public CreatureLib::Library::DataLibrary {
class PokemonLibrary final : public CreatureLib::Library::DataLibrary {
private:
std::unique_ptr<const NatureLibrary> _natures;

View File

@ -5,7 +5,7 @@
#include "../Moves/MoveData.hpp"
namespace PkmnLib::Library {
class LearnableMoves : public CreatureLib::Library::LearnableAttacks {
class LearnableMoves final : public CreatureLib::Library::LearnableAttacks {
ArbUt::List<ArbUt::BorrowedPtr<const MoveData>> _eggMoves;
public:

View File

@ -5,7 +5,7 @@
#include "LearnableMoves.hpp"
namespace PkmnLib::Library {
class PokemonForme : public CreatureLib::Library::SpeciesVariant {
class PokemonForme final : public CreatureLib::Library::SpeciesVariant {
public:
PokemonForme(const ArbUt::StringView& name, float height, float weight, uint32_t baseExperience,
const ArbUt::List<uint8_t>& types, CreatureLib::Library::StatisticSet<uint16_t> baseStats,

View File

@ -5,7 +5,7 @@
#include "PokemonForme.hpp"
namespace PkmnLib::Library {
class PokemonSpecies : public CreatureLib::Library::CreatureSpecies {
class PokemonSpecies final : public CreatureLib::Library::CreatureSpecies {
private:
uint8_t _baseHappiness;
ArbUt::UniquePtrList<const EvolutionData> _evolutions;

View File

@ -5,7 +5,7 @@
#include "PokemonSpecies.hpp"
namespace PkmnLib::Library {
class SpeciesLibrary : public CreatureLib::Library::SpeciesLibrary {
class SpeciesLibrary final : public CreatureLib::Library::SpeciesLibrary {
ArbUt::Dictionary<ArbUt::BorrowedPtr<const PokemonSpecies>, ArbUt::BorrowedPtr<const PokemonSpecies>>
_preEvolutionCache;

View File

@ -10,7 +10,7 @@
#include "AngelScriptScript.hpp"
#include "AngelScriptTypeInfo.hpp"
class AngelScriptResolver : public CreatureLib::Battling::ScriptResolver {
class AngelScriptResolver final : public CreatureLib::Battling::ScriptResolver {
private:
asIScriptEngine* _engine = nullptr;
asIScriptModule* _mainModule = nullptr;

View File

@ -9,7 +9,7 @@
#include "ContextPool.hpp"
class AngelScriptResolver;
class AngelScriptScript : public PkmnLib::Battling::PkmnScript {
class AngelScriptScript final : public PkmnLib::Battling::PkmnScript {
private:
AngelScriptResolver* _resolver = nullptr;
AngelScriptTypeInfo* _type = nullptr;