2008-01-10 19:01:25 +00:00
|
|
|
#pragma once
|
2008-01-09 17:21:31 +00:00
|
|
|
#include "global.h"
|
|
|
|
#include "SDL.h"
|
|
|
|
#include "CPlayerInterface.h"
|
2008-01-19 11:55:04 +00:00
|
|
|
//#include "boost/tuple/tuple.hpp"
|
2008-01-09 17:21:31 +00:00
|
|
|
class CGTownInstance;
|
2008-01-15 21:38:01 +00:00
|
|
|
class CTownHandler;
|
|
|
|
struct Structure;
|
2008-01-09 17:21:31 +00:00
|
|
|
template <typename T> class AdventureMapButton;
|
2008-01-20 16:24:03 +00:00
|
|
|
class CBuildingRect : public Hoverable, public ClickableL, public ClickableR//, public TimeInterested
|
2008-01-09 17:21:31 +00:00
|
|
|
{
|
2008-01-19 11:55:04 +00:00
|
|
|
public:
|
|
|
|
Structure* str;
|
|
|
|
CDefHandler* def;
|
|
|
|
SDL_Surface* border;
|
|
|
|
SDL_Surface* area;
|
|
|
|
CBuildingRect(Structure *Str);
|
|
|
|
~CBuildingRect();
|
2008-01-09 17:21:31 +00:00
|
|
|
void activate();
|
|
|
|
void deactivate();
|
2008-01-19 11:55:04 +00:00
|
|
|
bool operator<(const CBuildingRect & p2) const;
|
2008-01-20 16:24:03 +00:00
|
|
|
void hover(bool on);
|
2008-01-19 11:55:04 +00:00
|
|
|
void clickLeft (tribool down);
|
|
|
|
void clickRight (tribool down);
|
2008-01-09 17:21:31 +00:00
|
|
|
};
|
|
|
|
|
2008-01-20 12:34:39 +00:00
|
|
|
class CCastleInterface : public IShowable, public IActivable
|
2008-01-09 17:21:31 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
SDL_Surface * townInt;
|
|
|
|
SDL_Surface * cityBg;
|
|
|
|
const CGTownInstance * town;
|
|
|
|
|
2008-01-19 12:26:55 +00:00
|
|
|
unsigned char animval, count;
|
|
|
|
|
2008-01-12 11:32:40 +00:00
|
|
|
CDefHandler *hall,*fort,
|
|
|
|
*bigTownPic, *flag;
|
2008-01-09 17:21:31 +00:00
|
|
|
|
|
|
|
AdventureMapButton<CCastleInterface> * exit;
|
|
|
|
|
2008-01-19 11:55:04 +00:00
|
|
|
std::vector<CBuildingRect*> buildings; //building id, building def, structure struct, border, filling
|
2008-01-15 21:38:01 +00:00
|
|
|
|
2008-01-09 17:21:31 +00:00
|
|
|
CCastleInterface(const CGTownInstance * Town, bool Activate=true);
|
|
|
|
~CCastleInterface();
|
2008-01-19 12:26:55 +00:00
|
|
|
void show(SDL_Surface * to=NULL);
|
|
|
|
void showAll(SDL_Surface * to=NULL);
|
2008-01-09 17:21:31 +00:00
|
|
|
void close();
|
|
|
|
void activate();
|
|
|
|
void deactivate();
|
|
|
|
};
|