mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-26 08:41:13 +02:00
cc7be20b07
Because of really huge amount of modifications here I've probably missed some minor stuff. I doubt if it's still compatible with gcc - some changes should be reapplied.
50 lines
1.3 KiB
C++
50 lines
1.3 KiB
C++
#ifndef CTOWNHANDLER_H
|
|
#define CTOWNHANDLER_H
|
|
#include "../global.h"
|
|
#include <set>
|
|
class CBuilding;
|
|
class CSpell;
|
|
class CHero;
|
|
class CGTownInstance;
|
|
class DLL_EXPORT CTown
|
|
{
|
|
public:
|
|
std::string name; //name of type
|
|
std::vector<std::string> names; //names of the town instances
|
|
std::vector<int> basicCreatures; //level (from 0) -> ID
|
|
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)
|
|
int bonus; //pic number
|
|
int typeID;
|
|
};
|
|
|
|
struct DLL_EXPORT Structure
|
|
{
|
|
int ID;
|
|
int3 pos;
|
|
std::string defName, borderName, areaName, name;
|
|
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);
|
|
}
|
|
};
|
|
|
|
class DLL_EXPORT CTownHandler
|
|
{
|
|
public:
|
|
std::vector<CTown> towns;
|
|
std::vector<std::string> tcommands, hcommands;
|
|
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
|
|
|
|
CTownHandler();
|
|
~CTownHandler();
|
|
void loadNames();
|
|
};
|
|
|
|
#endif //CTOWNHANDLER_H
|