2019-10-31 11:02:23 +00:00
|
|
|
#include "TurnHandler.hpp"
|
2019-10-31 12:26:56 +00:00
|
|
|
#include "../../Core/Exceptions/NotImplementedException.hpp"
|
2019-10-31 11:02:23 +00:00
|
|
|
|
|
|
|
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 11:02:23 +00:00
|
|
|
|
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 11:02:23 +00:00
|
|
|
}
|
2019-10-31 12:13:36 +00:00
|
|
|
|
|
|
|
void CreatureLib::Battling::TurnHandler::ExecuteAttackChoice(const CreatureLib::Battling::AttackTurnChoice *choice) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|