CBattleObstacleController.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * CBattleObstacleController.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. struct SDL_Surface;
  12. struct BattleObjectsByHex;
  13. struct BattleHex;
  14. class IImage;
  15. class CAnimation;
  16. class CBattleInterface;
  17. class CObstacleInstance;
  18. struct Point;
  19. class CBattleObstacleController
  20. {
  21. std::map<std::string, std::shared_ptr<CAnimation>> animationsCache;
  22. CBattleInterface * owner;
  23. std::map<si32, std::shared_ptr<CAnimation>> obstacleAnimations;
  24. std::shared_ptr<IImage> getObstacleImage(const CObstacleInstance & oi);
  25. Point getObstaclePosition(std::shared_ptr<IImage> image, const CObstacleInstance & obstacle);
  26. public:
  27. CBattleObstacleController(CBattleInterface * owner);
  28. void obstaclePlaced(const CObstacleInstance & oi);
  29. void showObstacles(SDL_Surface *to, std::vector<std::shared_ptr<const CObstacleInstance>> &obstacles);
  30. void showAbsoluteObstacles(SDL_Surface *to);
  31. void showBattlefieldObjects(SDL_Surface *to, const BattleHex & location );
  32. void redrawBackgroundWithHexes(SDL_Surface * to);
  33. };