CAdventureAI.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * CAdventureAI.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "CGlobalAI.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. //class to be inherited by adventure-only AIs, it cedes battle actions to given battle-AI
  14. class DLL_LINKAGE CAdventureAI : public CGlobalAI
  15. {
  16. public:
  17. CAdventureAI() = default;
  18. std::shared_ptr<CBattleGameInterface> battleAI;
  19. std::shared_ptr<CBattleCallback> cbc;
  20. virtual std::string getBattleAIName() const = 0; //has to return name of the battle AI to be used
  21. //battle interface
  22. void activeStack(const BattleID & battleID, const CStack * stack) override;
  23. void yourTacticPhase(const BattleID & battleID, int distance) override;
  24. void battleNewRound(const BattleID & battleID) override;
  25. void battleCatapultAttacked(const BattleID & battleID, const CatapultAttack & ca) override;
  26. void battleStart(const BattleID & battleID, const CCreatureSet *army1, const CCreatureSet *army2, int3 tile, const CGHeroInstance *hero1, const CGHeroInstance *hero2, BattleSide side, bool replayAllowed) override;
  27. void battleStacksAttacked(const BattleID & battleID, const std::vector<BattleStackAttacked> & bsa, bool ranged) override;
  28. void actionStarted(const BattleID & battleID, const BattleAction &action) override;
  29. void battleNewRoundFirst(const BattleID & battleID) override;
  30. void actionFinished(const BattleID & battleID, const BattleAction &action) override;
  31. void battleStacksEffectsSet(const BattleID & battleID, const SetStackEffect & sse) override;
  32. void battleTriggerEffect(const BattleID & battleID, const BattleTriggerEffect & bte) override;
  33. void battleObstaclesChanged(const BattleID & battleID, const std::vector<ObstacleChanges> & obstacles) override;
  34. void battleStackMoved(const BattleID & battleID, const CStack * stack, const BattleHexArray & dest, int distance, bool teleport) override;
  35. void battleAttack(const BattleID & battleID, const BattleAttack *ba) override;
  36. void battleSpellCast(const BattleID & battleID, const BattleSpellCast *sc) override;
  37. void battleEnd(const BattleID & battleID, const BattleResult *br, QueryID queryID) override;
  38. void battleUnitsChanged(const BattleID & battleID, const std::vector<UnitChanges> & units) override;
  39. };
  40. VCMI_LIB_NAMESPACE_END