CreatureLib/src/Battling/Flow/ChoiceQueue.hpp

31 lines
772 B
C++
Raw Normal View History

#ifndef CREATURELIB_CHOICEQUEUE_HPP
#define CREATURELIB_CHOICEQUEUE_HPP
#include <utility>
#include <vector>
#include "../TurnChoices/BaseTurnChoice.hpp"
namespace CreatureLib::Battling {
class ChoiceQueue {
std::vector<BaseTurnChoice*> _queue;
size_t _current = 0;
public:
bool HasCompletedQueue = false;
explicit ChoiceQueue(std::vector<BaseTurnChoice*> queue) : _queue(std::move(queue)) {}
BaseTurnChoice* Dequeue() {
auto b = _queue[_current];
_current++;
return b;
}
[[nodiscard]] bool HasNext() const { return _current < _queue.size(); }
std::vector<BaseTurnChoice*>& GetInnerQueue() { return _queue; }
};
}
#endif // CREATURELIB_CHOICEQUEUE_HPP