Files
CreatureLib/src/Battling/Flow/ChoiceQueue.hpp
Deukhoofd 53bfbd36c2
Some checks failed
continuous-integration/drone/push Build is failing
Use a precompiled header.
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
2020-09-25 13:05:15 +02:00

29 lines
888 B
C++

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