CreatureLib/src/Battling/Models/Battle.hpp

41 lines
1.1 KiB
C++
Raw Normal View History

2019-10-17 12:33:25 +00:00
#ifndef CREATURELIB_BATTLE_HPP
#define CREATURELIB_BATTLE_HPP
#include <vector>
#include "BattleSide.hpp"
#include "../Library/BattleLibrary.hpp"
#include "../TurnChoices/BaseTurnChoice.hpp"
#include "../Flow/ChoiceQueue.hpp"
2019-11-02 12:57:43 +00:00
#include "Target.hpp"
2019-10-17 12:33:25 +00:00
namespace CreatureLib::Battling {
class Battle {
const BattleLibrary* _library;
uint8_t _numberOfSides;
uint8_t _creaturesPerSide;
2019-10-17 12:33:25 +00:00
std::vector<BattleSide*> _sides;
2019-10-31 11:31:31 +00:00
Core::Random _random;
ChoiceQueue* _currentTurnQueue = nullptr;
2019-10-17 12:33:25 +00:00
public:
const BattleLibrary* GetLibrary() const;
2019-11-02 12:57:43 +00:00
virtual bool CanUse(const BaseTurnChoice* choice);
virtual bool TrySetChoice(BaseTurnChoice* choice);
void CheckChoicesSetAndRun();
ChoiceQueue* GetCurrentTurnQueue() const;
2019-10-31 11:31:31 +00:00
Core::Random& GetRandom();
2019-11-02 12:57:43 +00:00
bool CreatureInField(const Creature* creature) const;
Creature* GetTarget(const Target& target){
return _sides[target.GetSideIndex()]->GetCreature(target.GetCreatureIndex());
}
2019-10-17 12:33:25 +00:00
};
}
#endif //CREATURELIB_BATTLE_HPP