Nullkiller.h 789 B

1234567891011121314151617181920212223242526272829
  1. #pragma once
  2. #include "PriorityEvaluator.h"
  3. #include "DangerHitMapAnalyzer.h"
  4. #include "../Goals/AbstractGoal.h"
  5. #include "../Behaviors/Behavior.h"
  6. class Nullkiller
  7. {
  8. private:
  9. std::unique_ptr<PriorityEvaluator> priorityEvaluator;
  10. HeroPtr activeHero;
  11. std::set<HeroPtr> lockedHeroes;
  12. public:
  13. std::unique_ptr<DangerHitMapAnalyzer> dangerHitMap;
  14. Nullkiller();
  15. void makeTurn();
  16. bool isActive(const CGHeroInstance * hero) const { return activeHero.h == hero; }
  17. void setActive(const HeroPtr & hero) { activeHero = hero; }
  18. void lockHero(const HeroPtr & hero) { lockedHeroes.insert(hero); }
  19. private:
  20. void resetAiState();
  21. void updateAiState();
  22. Goals::TSubgoal choseBestTask(std::shared_ptr<Behavior> behavior) const;
  23. Goals::TSubgoal choseBestTask(Goals::TGoalVec & tasks) const;
  24. };