CreatureLib/src/Battling/Flow/TurnHandler.cpp

26 lines
855 B
C++
Raw Normal View History

#include "TurnHandler.hpp"
2019-10-31 12:26:56 +00:00
#include "../../Core/Exceptions/NotImplementedException.hpp"
void CreatureLib::Battling::TurnHandler::RunTurn(CreatureLib::Battling::ChoiceQueue &queue) {
2019-10-31 12:13:36 +00:00
while (queue.HasNext()){
ExecuteChoice(queue.Dequeue());
}
}
2019-10-31 12:13:36 +00:00
void CreatureLib::Battling::TurnHandler::ExecuteChoice(const CreatureLib::Battling::BaseTurnChoice *choice) {
switch (choice->GetKind()){
case TurnChoiceKind::Pass: return;
case TurnChoiceKind::Attack:
return ExecuteAttackChoice(static_cast<const AttackTurnChoice*>(choice));
case TurnChoiceKind::Item:
case TurnChoiceKind::Switch:
case TurnChoiceKind::RunAway:
2019-10-31 12:26:56 +00:00
throw NotImplementedException();
2019-10-31 12:13:36 +00:00
}
}
2019-10-31 12:13:36 +00:00
void CreatureLib::Battling::TurnHandler::ExecuteAttackChoice(const CreatureLib::Battling::AttackTurnChoice *choice) {
}