Rework exceptions.
Some checks failed
continuous-integration/drone/push Build is failing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2020-08-15 16:34:52 +02:00
parent c921d3127b
commit 93a763ab78
12 changed files with 29 additions and 55 deletions

View File

@@ -1,7 +1,7 @@
#ifndef CREATURELIB_CLAMPEDSTATISTICSET_HPP
#define CREATURELIB_CLAMPEDSTATISTICSET_HPP
#include "Exceptions/NotReachableException.hpp"
#include "Exceptions/CreatureException.hpp"
#include "Statistic.hpp"
namespace CreatureLib::Library {
template <class T, int Min, int Max> class ClampedStatisticSet {
@@ -36,7 +36,7 @@ namespace CreatureLib::Library {
case CreatureLib::Library::Statistic::MagicalAttack: return _magicalAttack;
case CreatureLib::Library::Statistic::MagicalDefense: return _magicalDefense;
case CreatureLib::Library::Statistic::Speed: return _speed;
default: throw NotReachableException();
default: NOT_REACHABLE;
}
}
@@ -52,7 +52,7 @@ namespace CreatureLib::Library {
case CreatureLib::Library::Statistic::MagicalAttack: _magicalAttack = value; break;
case CreatureLib::Library::Statistic::MagicalDefense: _magicalDefense = value; break;
case CreatureLib::Library::Statistic::Speed: _speed = value; break;
default: throw NotReachableException();
default: NOT_REACHABLE;
}
}
@@ -78,7 +78,7 @@ namespace CreatureLib::Library {
case CreatureLib::Library::Statistic::MagicalAttack: ModifyStat(_magicalAttack, +) break;
case CreatureLib::Library::Statistic::MagicalDefense: ModifyStat(_magicalDefense, +) break;
case CreatureLib::Library::Statistic::Speed: ModifyStat(_speed, +) break;
default: throw NotReachableException();
default: NOT_REACHABLE;
}
}
inline bool DecreaseStatBy(Statistic stat, T amount) {
@@ -89,7 +89,7 @@ namespace CreatureLib::Library {
case CreatureLib::Library::Statistic::MagicalAttack: ModifyStat(_magicalAttack, -) break;
case CreatureLib::Library::Statistic::MagicalDefense: ModifyStat(_magicalDefense, -) break;
case CreatureLib::Library::Statistic::Speed: ModifyStat(_speed, -) break;
default: throw NotReachableException();
default: NOT_REACHABLE;
}
}
};