1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-30 08:57:00 +02:00
vcmi/CCastleInterface.h

58 lines
1.5 KiB
C
Raw Normal View History

#pragma once
2008-01-09 19:21:31 +02:00
#include "global.h"
#include "SDL.h"
#include "CPlayerInterface.h"
//#include "boost/tuple/tuple.hpp"
2008-01-09 19:21:31 +02:00
class CGTownInstance;
class CTownHandler;
struct Structure;
2008-01-09 19:21:31 +02:00
template <typename T> class AdventureMapButton;
2008-01-24 00:15:33 +02:00
class CBuildingRect : public Hoverable, public MotionInterested, public ClickableL, public ClickableR//, public TimeInterested
2008-01-09 19:21:31 +02:00
{
public:
Structure* str;
CDefHandler* def;
SDL_Surface* border;
SDL_Surface* area;
CBuildingRect(Structure *Str);
~CBuildingRect();
2008-01-09 19:21:31 +02:00
void activate();
void deactivate();
bool operator<(const CBuildingRect & p2) const;
2008-01-20 18:24:03 +02:00
void hover(bool on);
void clickLeft (tribool down);
void clickRight (tribool down);
2008-01-24 00:15:33 +02:00
void mouseMoved (SDL_MouseMotionEvent & sEvent);
2008-01-09 19:21:31 +02:00
};
class CCastleInterface : public IShowable, public IActivable
2008-01-09 19:21:31 +02:00
{
public:
2008-01-24 00:15:33 +02:00
CBuildingRect * hBuild; //highlighted building
2008-01-09 19:21:31 +02:00
SDL_Surface * townInt;
SDL_Surface * cityBg;
const CGTownInstance * town;
CStatusBar * statusbar;
2008-01-09 19:21:31 +02:00
2008-01-19 14:26:55 +02:00
unsigned char animval, count;
CDefHandler *hall,*fort,
*bigTownPic, *flag;
2008-01-09 19:21:31 +02:00
CTownList<CCastleInterface> * townlist;
CGarrisonInt * garr;
AdventureMapButton<CCastleInterface> * exit, *split;
2008-01-09 19:21:31 +02:00
std::vector<CBuildingRect*> buildings; //building id, building def, structure struct, border, filling
2008-01-09 19:21:31 +02:00
CCastleInterface(const CGTownInstance * Town, bool Activate=true);
~CCastleInterface();
void townChange();
2008-01-19 14:26:55 +02:00
void show(SDL_Surface * to=NULL);
void showAll(SDL_Surface * to=NULL);
2008-01-09 19:21:31 +02:00
void close();
void splitF();
2008-01-09 19:21:31 +02:00
void activate();
void deactivate();
};