refactor: changed cast type

This commit is contained in:
2021-11-21 17:21:34 +01:00
parent 2e14827f13
commit 36f1430ff2

View File

@@ -114,7 +114,7 @@ public:
const Tower* getLastDamageTower() { return m_LastDamage; }
void damage(float dmg, const Tower* damager) { m_Health = std::max(0.0f, m_Health - dmg); m_LastDamage = damager; }
void heal(float heal) { m_Health = std::min((float)getStats()->getMaxLife(), m_Health + heal); }
void heal(float heal) { m_Health = std::min(static_cast<float>(getStats()->getMaxLife()), m_Health + heal); }
float getX() const { return m_X; }
void setX(float x) { m_X = x; }
@@ -132,7 +132,7 @@ public:
Direction getDirection() const { return m_Direction; }
void setDirection(Direction dir) { m_Direction = dir; }
protected:
void initHealth() { m_Health = (float)getStats()->getMaxLife(); }
void initHealth() { m_Health = static_cast<float>(getStats()->getMaxLife()); }
private:
void updateEffects(std::uint64_t delta);
EffectDuration& getEffect(EffectType type);