This commit is contained in:
		@@ -1,4 +1,5 @@
 | 
			
		||||
#include "TurnHandler.hpp"
 | 
			
		||||
#include "../../Core/Exceptions/NotImplementedException.hpp"
 | 
			
		||||
 | 
			
		||||
void CreatureLib::Battling::TurnHandler::RunTurn(CreatureLib::Battling::ChoiceQueue &queue) {
 | 
			
		||||
    while (queue.HasNext()){
 | 
			
		||||
@@ -14,7 +15,7 @@ void CreatureLib::Battling::TurnHandler::ExecuteChoice(const CreatureLib::Battli
 | 
			
		||||
        case TurnChoiceKind::Item:
 | 
			
		||||
        case TurnChoiceKind::Switch:
 | 
			
		||||
        case TurnChoiceKind::RunAway:
 | 
			
		||||
            throw "Not implemented";
 | 
			
		||||
            throw NotImplementedException();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,5 +1,6 @@
 | 
			
		||||
#include "BattleStatCalculator.hpp"
 | 
			
		||||
#include "../Models/Creature.hpp"
 | 
			
		||||
#include "../../Core/Exceptions/NotImplementedException.hpp"
 | 
			
		||||
 | 
			
		||||
using namespace CreatureLib;
 | 
			
		||||
 | 
			
		||||
@@ -49,5 +50,5 @@ uint32_t Battling::BattleStatCalculator::CalculateFlatStat(Battling::Creature *c
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
uint32_t Battling::BattleStatCalculator::CalculateBoostedStat(Battling::Creature *creature, Core::Statistic stat) const{
 | 
			
		||||
    throw "TODO";
 | 
			
		||||
    throw NotImplementedException();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,5 @@
 | 
			
		||||
#include "BattleSide.hpp"
 | 
			
		||||
#include "../../Core/Exceptions/CreatureException.hpp"
 | 
			
		||||
#include <algorithm>
 | 
			
		||||
 | 
			
		||||
using namespace CreatureLib::Battling;
 | 
			
		||||
@@ -25,7 +26,7 @@ const std::vector<const BaseTurnChoice *>& BattleSide::GetChoices() const{
 | 
			
		||||
void BattleSide::SetChoice(const BaseTurnChoice *choice) {
 | 
			
		||||
    auto find = std::find(_creatures.begin(), _creatures.end(), choice->GetUser());
 | 
			
		||||
    if (find ==_creatures.end())
 | 
			
		||||
        throw "User not found";
 | 
			
		||||
        throw CreatureException("User not found");
 | 
			
		||||
    uint8_t index = std::distance(_creatures.begin(),find);
 | 
			
		||||
    _choices[index] = choice;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -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