Used ClangFormat style guide I'm happy with.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-11-28 12:55:22 +01:00
parent 3b685ae782
commit a8730d983f
91 changed files with 946 additions and 1121 deletions

View File

@@ -5,31 +5,26 @@
#include <vector>
#include "../TurnChoices/BaseTurnChoice.hpp"
namespace CreatureLib::Battling{
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)){}
explicit ChoiceQueue(std::vector<BaseTurnChoice*> queue) : _queue(std::move(queue)) {}
BaseTurnChoice* Dequeue(){
BaseTurnChoice* Dequeue() {
auto b = _queue[_current];
_current++;
return b;
}
[[nodiscard]] bool HasNext() const{
return _current < _queue.size();
}
[[nodiscard]] bool HasNext() const { return _current < _queue.size(); }
std::vector<BaseTurnChoice*>& GetInnerQueue(){
return _queue;
}
std::vector<BaseTurnChoice*>& GetInnerQueue() { return _queue; }
};
}
#endif //CREATURELIB_CHOICEQUEUE_HPP
#endif // CREATURELIB_CHOICEQUEUE_HPP