mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
changed CBonusSystemNode* to BonusList in CSkill
This commit is contained in:
parent
fbab52eb18
commit
159e27a0ab
@ -29,14 +29,13 @@
|
||||
///CSkill
|
||||
CSkill::CSkill()
|
||||
{
|
||||
BonusList emptyList;
|
||||
for(auto level : NSecondarySkill::levels)
|
||||
bonusByLevel.push_back(new CBonusSystemNode());
|
||||
bonusByLevel.push_back(emptyList);
|
||||
}
|
||||
|
||||
CSkill::~CSkill()
|
||||
{
|
||||
for(auto bonus : bonusByLevel)
|
||||
delete bonus;
|
||||
}
|
||||
|
||||
void CSkill::addNewBonus(const std::shared_ptr<Bonus>& b, int level)
|
||||
@ -44,10 +43,10 @@ void CSkill::addNewBonus(const std::shared_ptr<Bonus>& b, int level)
|
||||
b->source = Bonus::SECONDARY_SKILL;
|
||||
b->duration = Bonus::PERMANENT;
|
||||
b->description = identifier;
|
||||
bonusByLevel[level]->addNewBonus(b);
|
||||
bonusByLevel[level].push_back(b);
|
||||
}
|
||||
|
||||
CBonusSystemNode * CSkill::getBonus(int level)
|
||||
BonusList CSkill::getBonus(int level)
|
||||
{
|
||||
return bonusByLevel[level];
|
||||
}
|
||||
|
@ -21,14 +21,14 @@ class JsonSerializeFormat;
|
||||
class DLL_LINKAGE CSkill // secondary skill
|
||||
{
|
||||
protected:
|
||||
std::vector<CBonusSystemNode *> bonusByLevel; // bonuses provided by none, basic, advanced and expert level
|
||||
std::vector<BonusList> bonusByLevel; // bonuses provided by none, basic, advanced and expert level
|
||||
|
||||
public:
|
||||
CSkill();
|
||||
~CSkill();
|
||||
|
||||
void addNewBonus(const std::shared_ptr<Bonus>& b, int level);
|
||||
CBonusSystemNode * getBonus(int level);
|
||||
BonusList getBonus(int level);
|
||||
|
||||
SecondarySkill id;
|
||||
std::string identifier;
|
||||
|
Loading…
Reference in New Issue
Block a user