29 lines
655 B
C++
29 lines
655 B
C++
|
#ifndef CREATURELIB_CHOICEQUEUE_HPP
|
||
|
#define CREATURELIB_CHOICEQUEUE_HPP
|
||
|
|
||
|
#include <vector>
|
||
|
#include "../TurnChoices/BaseTurnChoice.hpp"
|
||
|
|
||
|
namespace CreatureLib::Battling{
|
||
|
class ChoiceQueue {
|
||
|
std::vector<const BaseTurnChoice*> _queue;
|
||
|
size_t _current = 0;
|
||
|
public:
|
||
|
ChoiceQueue(const std::vector<const BaseTurnChoice*>& queue)
|
||
|
:_queue(queue){}
|
||
|
|
||
|
const BaseTurnChoice* Dequeue(){
|
||
|
auto b = _queue[_current];
|
||
|
_current++;
|
||
|
return b;
|
||
|
}
|
||
|
|
||
|
bool HasNext() const{
|
||
|
return _current < _queue.size();
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
|
||
|
#endif //CREATURELIB_CHOICEQUEUE_HPP
|