mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-28 08:48:48 +02:00
0cae259f53
- refactoring of CBattleStacksController.cpp - moved EAlignment enum to Geometries.h from CIntObject - renamed EAlignment to ETextAlignment, to avoid conflict with good/evil alignemt - ETextAlignment is now enum class
44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
/*
|
|
* CBattleObstacleController.h, part of VCMI engine
|
|
*
|
|
* Authors: listed in file AUTHORS in main folder
|
|
*
|
|
* License: GNU General Public License v2.0 or later
|
|
* Full text of license available in license.txt file, in main folder
|
|
*
|
|
*/
|
|
#pragma once
|
|
|
|
struct SDL_Surface;
|
|
struct BattleObjectsByHex;
|
|
struct BattleHex;
|
|
class IImage;
|
|
class CCanvas;
|
|
class CAnimation;
|
|
class CBattleInterface;
|
|
class CObstacleInstance;
|
|
struct Point;
|
|
|
|
class CBattleObstacleController
|
|
{
|
|
std::map<std::string, std::shared_ptr<CAnimation>> animationsCache;
|
|
|
|
CBattleInterface * owner;
|
|
|
|
std::map<si32, std::shared_ptr<CAnimation>> obstacleAnimations;
|
|
|
|
std::shared_ptr<IImage> getObstacleImage(const CObstacleInstance & oi);
|
|
Point getObstaclePosition(std::shared_ptr<IImage> image, const CObstacleInstance & obstacle);
|
|
|
|
public:
|
|
CBattleObstacleController(CBattleInterface * owner);
|
|
|
|
void obstaclePlaced(const CObstacleInstance & oi);
|
|
void showObstacles(SDL_Surface *to, std::vector<std::shared_ptr<const CObstacleInstance>> &obstacles);
|
|
void showAbsoluteObstacles(std::shared_ptr<CCanvas> canvas);
|
|
|
|
void showBattlefieldObjects(std::shared_ptr<CCanvas> canvas, const BattleHex & location );
|
|
|
|
void redrawBackgroundWithHexes(std::shared_ptr<CCanvas> to);
|
|
};
|