Make SpeciesVariants smart pointers.
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
2020-05-26 14:35:18 +02:00
parent 36208da2fb
commit 8418c814b4
6 changed files with 50 additions and 37 deletions

View File

@@ -7,10 +7,11 @@
using namespace CreatureLib;
Battling::Creature::Creature(const BattleLibrary* library, const borrowed_ptr<const Library::CreatureSpecies>& species,
const Library::SpeciesVariant* variant, uint8_t level, uint32_t experience, uint32_t uid,
Library::Gender gender, uint8_t coloring, const borrowed_ptr<const Library::Item> heldItem,
std::string nickname, const Library::TalentIndex& talent,
const List<LearnedAttack*>& attacks, bool allowedExperienceGain)
const borrowed_ptr<const Library::SpeciesVariant>& variant, uint8_t level,
uint32_t experience, uint32_t uid, Library::Gender gender, uint8_t coloring,
const borrowed_ptr<const Library::Item> heldItem, std::string nickname,
const Library::TalentIndex& talent, const List<LearnedAttack*>& attacks,
bool allowedExperienceGain)
: _library(library), _species(species), _variant(variant), _level(level), _experience(experience),
_uniqueIdentifier(uid), _gender(gender), _coloring(coloring), _heldItem(heldItem), _nickname(std::move(nickname)),
_talentIndex(talent), _hasOverridenTalent(false), _attacks(attacks),
@@ -191,7 +192,7 @@ borrowed_ptr<const Library::CreatureSpecies> Battling::Creature::GetDisplaySpeci
species = _species;
return species;
}
const Library::SpeciesVariant* Battling::Creature::GetDisplayVariant() const noexcept {
borrowed_ptr<const Library::SpeciesVariant> Battling::Creature::GetDisplayVariant() const noexcept {
auto variant = _displayVariant;
if (variant == nullptr)
variant = _variant;