Nullkiller.h 858 B

123456789101112131415161718192021222324252627282930
  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. void unlockHero(const HeroPtr & hero) { lockedHeroes.erase(hero); }
  20. private:
  21. void resetAiState();
  22. void updateAiState();
  23. Goals::TSubgoal choseBestTask(std::shared_ptr<Behavior> behavior) const;
  24. Goals::TSubgoal choseBestTask(Goals::TGoalVec & tasks) const;
  25. };