Another rework for scripthooks, for better performance.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This new version caches pointers to the pointers to scripts, so that we can build the data once and then simply iterate over it whenever we want to run a hook.
This commit is contained in:
@@ -18,7 +18,8 @@ namespace CreatureLib::Battling{
|
||||
|
||||
class Creature : public ScriptSource{
|
||||
GetProperty(const Library::CreatureSpecies*, Species);
|
||||
GetProperty(const Library::SpeciesVariant*, Variant);
|
||||
GetProperty(const Library::SpeciesVariant*, Variant)
|
||||
|
||||
GetProperty(uint8_t, Level);
|
||||
GetProperty(uint32_t, Experience);
|
||||
GetProperty(Core::StatisticSet<uint8_t >, StatExperience);
|
||||
@@ -67,7 +68,7 @@ namespace CreatureLib::Battling{
|
||||
[[nodiscard]] const std::vector<uint8_t>& GetTypes() const;
|
||||
[[nodiscard]] bool HasType(uint8_t type) const;
|
||||
|
||||
void GetActiveScripts(ScriptAggregator& aggr) const override;
|
||||
void GetActiveScripts(std::vector<ScriptWrapper> &scripts) override;
|
||||
|
||||
//region Stat APIs
|
||||
|
||||
@@ -85,6 +86,7 @@ namespace CreatureLib::Battling{
|
||||
void RecalculateBoostedStats();
|
||||
void RecalculateFlatStat(Core::Statistic);
|
||||
void RecalculateBoostedStat(Core::Statistic);
|
||||
|
||||
//endregion
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user