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