CBattleHero.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "../UIFramework/CIntObject.h"
  3. class CBattleInterface;
  4. class CDefHandler;
  5. class CGHeroInstance;
  6. struct SDL_Surface;
  7. /*
  8. * CBattleHero.h, part of VCMI engine
  9. *
  10. * Authors: listed in file AUTHORS in main folder
  11. *
  12. * License: GNU General Public License v2.0 or later
  13. * Full text of license available in license.txt file, in main folder
  14. *
  15. */
  16. /// Hero battle animation
  17. class CBattleHero : public CIntObject
  18. {
  19. public:
  20. bool flip; //false if it's attacking hero, true otherwise
  21. CDefHandler *dh, *flag; //animation and flag
  22. const CGHeroInstance *myHero; //this animation's hero instance
  23. const CBattleInterface *myOwner; //battle interface to which this animation is assigned
  24. int phase; //stage of animation
  25. int nextPhase; //stage of animation to be set after current phase is fully displayed
  26. int image; //frame of animation
  27. ui8 flagAnim, flagAnimCount; //for flag animation
  28. void show(SDL_Surface *to); //prints next frame of animation to to
  29. void activate();
  30. void deactivate();
  31. void setPhase(int newPhase); //sets phase of hero animation
  32. void clickLeft(tribool down, bool previousState); //call-in
  33. CBattleHero(const std::string &defName, int phaseG, int imageG, bool filpG, ui8 player, const CGHeroInstance *hero, const CBattleInterface *owner); //c-tor
  34. ~CBattleHero(); //d-tor
  35. };