Files
vcmi/hch/CTownHandler.h
T

52 lines
1.3 KiB
C++
Raw Normal View History

2007-07-26 12:00:18 +00:00
#ifndef CTOWNHANDLER_H
#define CTOWNHANDLER_H
2008-06-13 08:16:51 +00:00
#include "../global.h"
#include <set>
2007-09-05 15:56:35 +00:00
class CBuilding;
class CSpell;
class CHero;
2007-10-27 19:38:48 +00:00
class CGTownInstance;
2008-06-17 17:48:32 +00:00
class DLL_EXPORT CTown
2007-07-26 12:00:18 +00:00
{
public:
2007-09-16 17:21:23 +00:00
std::string name; //name of type
std::vector<std::string> names; //names of the town instances
2008-02-05 03:56:45 +00:00
std::vector<int> basicCreatures; //level (from 0) -> ID
2008-04-04 17:30:53 +00:00
std::vector<int> upgradedCreatures; //level (from 0) -> ID
std::map<int,int> hordeLvl; //[0] - first horde building creature level; [1] - second horde building (-1 if not present)
ui32 mageLevel; //max available mage guild level
2007-07-26 12:00:18 +00:00
int bonus; //pic number
ui16 primaryRes, warMachine;
ui8 typeID;
2007-07-26 12:00:18 +00:00
};
2007-09-05 15:56:35 +00:00
2008-06-13 08:16:51 +00:00
struct DLL_EXPORT Structure
{
int ID;
int3 pos;
2008-01-27 20:37:10 +00:00
std::string defName, borderName, areaName, name;
2008-01-27 13:18:18 +00:00
int townID, group;
bool operator<(const Structure & p2) const
{
if(pos.z != p2.pos.z)
return (pos.z) < (p2.pos.z);
else
return (ID) < (p2.ID);
}
};
2008-06-13 08:16:51 +00:00
class DLL_EXPORT CTownHandler
2007-07-26 12:00:18 +00:00
{
public:
std::vector<CTown> towns;
2008-03-11 21:36:59 +00:00
std::vector<std::string> tcommands, hcommands;
2008-01-27 13:18:18 +00:00
std::map<int,std::map<int, Structure*> > structures; // <town ID, <structure ID, structure>>
std::map<int, std::map<int,std::set<int> > > requirements; //requirements[town_id][structure_id] -> set of required buildings
2008-06-13 08:16:51 +00:00
CTownHandler();
~CTownHandler();
void loadNames();
2007-07-26 12:00:18 +00:00
};
2007-09-05 15:56:35 +00:00
2008-08-02 15:08:03 +00:00
#endif //CTOWNHANDLER_H