This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "CreateCreature.hpp"
|
||||
#include "../../Core/Exceptions/CreatureException.hpp"
|
||||
#include <utility>
|
||||
|
||||
using namespace CreatureLib::Battling;
|
||||
@@ -67,8 +68,7 @@ CreateCreature *CreateCreature::WithGender(Library::Gender gender) {
|
||||
|
||||
CreateCreature *CreateCreature::WithAttack(const std::string& attackName, AttackLearnMethod learnMethod) {
|
||||
if (_attacks.size() >= _library->GetSettings().GetMaximalMoves())
|
||||
//TODO: Better exception
|
||||
throw "";
|
||||
throw CreatureException("You have already set the maximum amount of allowed moves.");
|
||||
|
||||
auto attackData = _library->GetAttackLibrary()->GetAttack(attackName);
|
||||
_attacks.emplace_back(attackData, learnMethod);
|
||||
|
||||
Reference in New Issue
Block a user