Basic layout for turn execution
This commit is contained in:
parent
7da87956cf
commit
ffba5fb24c
|
@ -1,5 +1,24 @@
|
||||||
#include "TurnHandler.hpp"
|
#include "TurnHandler.hpp"
|
||||||
|
|
||||||
void CreatureLib::Battling::TurnHandler::RunTurn(CreatureLib::Battling::ChoiceQueue &queue) {
|
void CreatureLib::Battling::TurnHandler::RunTurn(CreatureLib::Battling::ChoiceQueue &queue) {
|
||||||
|
while (queue.HasNext()){
|
||||||
|
ExecuteChoice(queue.Dequeue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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:
|
||||||
|
throw "Not implemented";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CreatureLib::Battling::TurnHandler::ExecuteAttackChoice(const CreatureLib::Battling::AttackTurnChoice *choice) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,15 @@
|
||||||
#define CREATURELIB_TURNHANDLER_HPP
|
#define CREATURELIB_TURNHANDLER_HPP
|
||||||
|
|
||||||
#include "ChoiceQueue.hpp"
|
#include "ChoiceQueue.hpp"
|
||||||
|
#include "../TurnChoices/AttackTurnChoice.hpp"
|
||||||
|
|
||||||
namespace CreatureLib::Battling {
|
namespace CreatureLib::Battling {
|
||||||
class Battle;
|
class Battle;
|
||||||
|
|
||||||
class TurnHandler {
|
class TurnHandler {
|
||||||
|
static void ExecuteChoice(const BaseTurnChoice* choice);
|
||||||
|
|
||||||
|
static void ExecuteAttackChoice(const AttackTurnChoice* choice);
|
||||||
public:
|
public:
|
||||||
static void RunTurn(ChoiceQueue& queue);
|
static void RunTurn(ChoiceQueue& queue);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue