CCastleInterface.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #pragma once
  2. #include "global.h"
  3. #include "SDL.h"
  4. #include "CPlayerInterface.h"
  5. //#include "boost/tuple/tuple.hpp"
  6. class CGTownInstance;
  7. class CTownHandler;
  8. struct Structure;
  9. template <typename T> class AdventureMapButton;
  10. class CBuildingRect : public Hoverable, public MotionInterested, public ClickableL, public ClickableR//, public TimeInterested
  11. {
  12. public:
  13. Structure* str;
  14. CDefHandler* def;
  15. SDL_Surface* border;
  16. SDL_Surface* area;
  17. CBuildingRect(Structure *Str);
  18. ~CBuildingRect();
  19. void activate();
  20. void deactivate();
  21. bool operator<(const CBuildingRect & p2) const;
  22. void hover(bool on);
  23. void clickLeft (tribool down);
  24. void clickRight (tribool down);
  25. void mouseMoved (SDL_MouseMotionEvent & sEvent);
  26. };
  27. class CCastleInterface : public IShowable, public IActivable
  28. {
  29. public:
  30. CBuildingRect * hBuild; //highlighted building
  31. SDL_Surface * townInt;
  32. SDL_Surface * cityBg;
  33. const CGTownInstance * town;
  34. CStatusBar * statusbar;
  35. unsigned char animval, count;
  36. CDefHandler *hall,*fort,
  37. *bigTownPic, *flag;
  38. CTownList<CCastleInterface> * townlist;
  39. CGarrisonInt * garr;
  40. AdventureMapButton<CCastleInterface> * exit, *split;
  41. std::vector<CBuildingRect*> buildings; //building id, building def, structure struct, border, filling
  42. CCastleInterface(const CGTownInstance * Town, bool Activate=true);
  43. ~CCastleInterface();
  44. void townChange();
  45. void show(SDL_Surface * to=NULL);
  46. void showAll(SDL_Surface * to=NULL);
  47. void close();
  48. void splitF();
  49. void activate();
  50. void deactivate();
  51. };