1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

battle improvements

This commit is contained in:
mateuszb
2008-03-15 17:48:05 +00:00
parent 7b88f4a70b
commit d106fdcf2a
6 changed files with 76 additions and 44 deletions

View File

@@ -22,18 +22,19 @@ public:
~CBattleHero(); //d-tor
};
class CBattleHex : public Hoverable
class CBattleHex : public Hoverable, public MotionInterested
{
public:
unsigned int myNumber;
bool accesible;
//CStack * ourStack;
bool hovered;
bool hovered, strictHovered;
static std::pair<int, int> getXYUnitAnim(int hexNum, bool attacker); //returns (x, y) of left top corner of animation
//for user interactions
void hover (bool on);
void activate();
void deactivate();
void mouseMoved (SDL_MouseMotionEvent & sEvent);
CBattleHex();
};
@@ -52,6 +53,7 @@ private:
CCreatureSet * army1, * army2; //fighting armies
CGHeroInstance * attackingHeroInstance, * defendingHeroInstance;
std::map< int, CCreatureAnimation * > creAnims; //animations of creatures from fighting armies (order like in BattleInfo's stacks)
unsigned char animCount;
public:
CBattleInterface(CCreatureSet * army1, CCreatureSet * army2, CGHeroInstance *hero1, CGHeroInstance *hero2); //c-tor