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

77 lines
1.7 KiB
C
Raw Normal View History

2007-07-26 15:00:18 +03:00
#ifndef CTOWNHANDLER_H
#define CTOWNHANDLER_H
2007-07-26 15:00:18 +03:00
#include "CDefHandler.h"
#include "CCreatureHandler.h"
2007-07-26 15:00:18 +03:00
#include "SDL.h"
#include "../int3.h"
2007-07-26 15:00:18 +03:00
#include <string>
#include <vector>
class CBuilding;
class CSpell;
class CHero;
class CTownInstance;
class CGTownInstance;
2008-01-09 19:21:31 +02:00
class CHeroInstance;
2007-07-26 15:00:18 +03:00
class CTown
{
public:
std::string name; //name of type
std::vector<std::string> names; //names of the town instances
2007-07-26 15:00:18 +03:00
int bonus; //pic number
int typeID;
2007-07-26 15:00:18 +03:00
};
struct Structure
{
int ID;
int3 pos;
std::string defName;
int townID;
};
2007-07-26 15:00:18 +03:00
class CTownHandler
{
CDefHandler * smallIcons;
public:
CTownHandler();
~CTownHandler();
std::vector<CTown> towns;
2008-01-09 19:21:31 +02:00
std::vector<std::string> tcommands;
2007-07-26 15:00:18 +03:00
void loadNames();
SDL_Surface * getPic(int ID, bool fort=true, bool builded=false); //ID=-1 - blank; -2 - border; -3 - random
static int getTypeByDefName(std::string name);
std::map<int,std::map<int, Structure*> > structures;
std::vector<CGTownInstance *> townInstances;
2007-07-26 15:00:18 +03:00
};
class CTownInstance
{
public:
int3 pos; //position
CTown * town;
std::string name; // name of town
CCreatureSet garrison;
int builded; //how many buildings has been built this turn
int destroyed; //how many buildings has been destroyed this turn
//TODO:
2008-01-09 19:21:31 +02:00
std::vector<CBuilding *> /*allBuildings,*/ possibleBuildings, builtBuildings;
std::vector<int> creatureIncome; //vector by level
std::vector<int> creaturesLeft; //that can be recruited
2008-01-09 19:21:31 +02:00
CHeroInstance * garrisonHero;
std::vector<CSpell *> possibleSpells, obligatorySpells, availableSpells;
int getSightDistance() const; //returns sight distance
CTownInstance();
};
2007-07-26 15:00:18 +03:00
#endif //CTOWNHANDLER_H