CCastleInterface.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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, *flag;
  37. CTownList<CCastleInterface> * townlist;
  38. CGarrisonInt * garr;
  39. AdventureMapButton<CCastleInterface> * exit, *split;
  40. std::vector<CBuildingRect*> buildings; //building id, building def, structure struct, border, filling
  41. CCastleInterface(const CGTownInstance * Town, bool Activate=true);
  42. ~CCastleInterface();
  43. void townChange();
  44. void show(SDL_Surface * to=NULL);
  45. void showAll(SDL_Surface * to=NULL);
  46. void close();
  47. void splitF();
  48. void activate();
  49. void deactivate();
  50. };