Pass LearnedAttack list to creature by reference.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
bf6f77d904
commit
83f427368e
|
@ -9,10 +9,11 @@ using namespace CreatureLib;
|
|||
Battling::Creature::Creature(const BattleLibrary* library, const Library::CreatureSpecies* species,
|
||||
const Library::SpeciesVariant* variant, uint8_t level, uint32_t experience, uint32_t uid,
|
||||
Library::Gender gender, uint8_t coloring, const Library::Item* heldItem,
|
||||
std::string nickname, const Library::TalentIndex& talent, List<LearnedAttack*> attacks)
|
||||
std::string nickname, const Library::TalentIndex& talent,
|
||||
const List<LearnedAttack*>& attacks)
|
||||
: _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(std::move(attacks)) {
|
||||
_talentIndex(talent), _hasOverridenTalent(false), _attacks(attacks) {
|
||||
AssertNotNull(library)
|
||||
AssertNotNull(species)
|
||||
AssertNotNull(variant)
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace CreatureLib::Battling {
|
|||
Creature(const BattleLibrary* library, const Library::CreatureSpecies* species,
|
||||
const Library::SpeciesVariant* variant, uint8_t level, uint32_t experience, uint32_t uid,
|
||||
Library::Gender gender, uint8_t coloring, const Library::Item* heldItem, std::string nickname,
|
||||
const Library::TalentIndex& talent, List<LearnedAttack*> attacks);
|
||||
const Library::TalentIndex& talent, const List<LearnedAttack*>& attacks);
|
||||
|
||||
virtual ~Creature() {
|
||||
for (auto attack : _attacks) {
|
||||
|
@ -129,7 +129,7 @@ namespace CreatureLib::Battling {
|
|||
void RemoveVolatileScript(Script* script);
|
||||
bool HasVolatileScript(const ConstString& name) const;
|
||||
|
||||
List<LearnedAttack*>& GetAttacks() noexcept { return _attacks; }
|
||||
const List<LearnedAttack*>& GetAttacks() noexcept { return _attacks; }
|
||||
|
||||
const Library::CreatureSpecies* GetDisplaySpecies() const noexcept;
|
||||
const Library::SpeciesVariant* GetDisplayVariant() const noexcept;
|
||||
|
|
Loading…
Reference in New Issue