1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-30 08:57:00 +02:00
vcmi/hch/CTownHandler.h
Michał W. Urbańczyk 7d4aa0c803 * resource bar
* function in CCallback for getting onfo about res
* giving resources at the beginning of game
* moved several txt files to /config subfolder
* minor changes
2007-09-16 17:21:23 +00:00

57 lines
1.3 KiB
C++

#ifndef CTOWNHANDLER_H
#define CTOWNHANDLER_H
#include "CDefHandler.h"
#include "CCreatureHandler.h"
#include "SDL.h"
#include "../int3.h"
#include <string>
#include <vector>
class CBuilding;
class CSpell;
class CHero;
class CTown
{
public:
std::string name; //name of type
std::vector<std::string> names; //names of the town instances
int bonus; //pic number
};
class CTownHandler
{
CDefHandler * smallIcons;
public:
CTownHandler();
~CTownHandler();
std::vector<CTown> towns;
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);
};
class CTownInstance
{
public:
int type; //type of town
int owner; //ID of owner
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:
std::vector<CBuilding *> allBuildings, possibleBuildings, builtBuildings;
std::vector<int> creatureIncome; //vector by level
std::vector<int> creaturesLeft; //that can be recruited
CHero * garrisonHero;
std::vector<CSpell *> possibleSpells, obligatorySpells, availableSpells;
};
#endif //CTOWNHANDLER_H