Remove GetProperty macro, as it wasn't that intuitive, and caused issues later.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-01-12 17:04:42 +01:00
parent 779f0b08cf
commit b02577554f
12 changed files with 95 additions and 88 deletions

View File

@@ -1,7 +1,6 @@
#ifndef CREATURELIB_BATTLECREATURE_HPP
#define CREATURELIB_BATTLECREATURE_HPP
#include "../../GenericTemplates.hpp"
#include "../../Library/CreatureData/CreatureSpecies.hpp"
#include "../../Library/Items/Item.hpp"
#include "../ScriptHandling/ScriptAggregator.hpp"
@@ -20,18 +19,17 @@ namespace CreatureLib::Battling {
protected:
const BattleLibrary* _library;
GetProperty(const Library::CreatureSpecies*, Species);
GetProperty(const Library::SpeciesVariant*, Variant);
const Library::CreatureSpecies* _species;
const Library::SpeciesVariant* _variant;
GetProperty(uint8_t, Level);
GetProperty(uint32_t, Experience);
GetProperty(uint32_t, UniqueIdentifier);
GetProperty(Library::Gender, Gender);
GetProperty(uint8_t, Coloring);
GetProperty(const Library::Item*, HeldItem);
GetProperty(uint32_t, CurrentHealth);
uint8_t _level;
uint32_t _experience;
uint32_t _uniqueIdentifier;
Library::Gender _gender;
uint8_t _coloring;
const Library::Item* _heldItem;
uint32_t _currentHealth;
protected:
Core::StatisticSet<int8_t> _statBoost;
Core::StatisticSet<uint32_t> _flatStats;
Core::StatisticSet<uint32_t> _boostedStats;
@@ -70,9 +68,18 @@ namespace CreatureLib::Battling {
virtual void Initialize() {
RecalculateFlatStats();
__CurrentHealth = GetBoostedStat(Core::Statistic::Health);
_currentHealth = GetBoostedStat(Core::Statistic::Health);
}
inline const Library::CreatureSpecies* GetSpecies() const { return _species; }
inline const Library::SpeciesVariant* GetVariant() const { return _variant; }
inline uint8_t GetLevel() const { return _level; }
inline uint32_t GetExperience() const { return _experience; }
inline Library::Gender GetGender() const { return _gender; }
inline uint8_t GetColoring() const { return _coloring; }
inline const Library::Item* GetHeldItem() const { return _heldItem; }
inline uint32_t GetCurrentHealth() const { return _currentHealth; }
void SetBattleData(Battle* battle, BattleSide* side);
Battle* GetBattle() const;
BattleSide* GetBattleSide() const;