Implement stat boosting

This commit is contained in:
2019-10-23 18:41:45 +02:00
parent 3e9d030dc4
commit cd21e6c685
4 changed files with 38 additions and 5 deletions

View File

@@ -55,6 +55,29 @@ namespace CreatureLib::Core{
}
throw std::exception();
}
inline void IncreaseStatBy(Statistic stat, T amount){
switch (stat){
case Health: _health += amount;
case PhysicalAttack: _physicalAttack += amount;
case PhysicalDefense: _physicalDefense += amount;
case MagicalAttack: _magicalAttack += amount;
case MagicalDefense: _magicalDefense += amount;
case Speed: _speed += amount;
}
throw std::exception();
}
inline void DecreaseStatBy(Statistic stat, T amount){
switch (stat){
case Health: _health -= amount;
case PhysicalAttack: _physicalAttack -= amount;
case PhysicalDefense: _physicalDefense -= amount;
case MagicalAttack: _magicalAttack -= amount;
case MagicalDefense: _magicalDefense -= amount;
case Speed: _speed -= amount;
}
throw std::exception();
}
};
}