2007-07-03 11:10:37 +03:00
|
|
|
#ifndef COBJINFOECTHANDLER_H
|
|
|
|
#define COBJINFOECTHANDLER_H
|
|
|
|
#include <vector>
|
2008-02-05 05:56:45 +02:00
|
|
|
#include <map>
|
|
|
|
class CDefHandler;
|
|
|
|
class CGDefInfo
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
std::string name;
|
2007-07-03 11:10:37 +03:00
|
|
|
|
2008-02-05 05:56:45 +02:00
|
|
|
unsigned char visitMap[6];
|
|
|
|
unsigned char blockMap[6];
|
|
|
|
int id, subid; //of object described by this defInfo
|
|
|
|
int terrainAllowed, //on which terrain it is possible to place object
|
|
|
|
terrainMenu; //in which menus in map editor object will be showed
|
|
|
|
int type; //(0- ground, 1- towns, 2-creatures, 3- heroes, 4-artifacts, 5- resources)
|
|
|
|
CDefHandler * handler;
|
|
|
|
int printPriority;
|
|
|
|
bool isVisitable();
|
|
|
|
bool operator<(const CGDefInfo& por)
|
|
|
|
{
|
|
|
|
if(id!=por.id)
|
|
|
|
return id<por.id;
|
|
|
|
else
|
|
|
|
return subid<por.subid;
|
|
|
|
}
|
|
|
|
};
|
2007-07-03 11:10:37 +03:00
|
|
|
struct DefObjInfo
|
|
|
|
{
|
|
|
|
std::string defName;
|
|
|
|
int priority;
|
|
|
|
int type, subtype;
|
|
|
|
int objType;
|
2007-08-07 16:49:15 +03:00
|
|
|
unsigned char visitMap[6];
|
|
|
|
unsigned char blockMap[6];
|
2007-07-03 11:10:37 +03:00
|
|
|
bool operator==(const std::string & por) const;
|
2007-10-25 19:14:43 +03:00
|
|
|
bool isVisitable() const;
|
2007-07-03 11:10:37 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
class CDefObjInfoHandler
|
|
|
|
{
|
|
|
|
public:
|
2008-02-05 05:56:45 +02:00
|
|
|
std::map<int,std::map<int,CGDefInfo*> > gobjs;
|
|
|
|
std::map<int,CGDefInfo*> castles;
|
|
|
|
//std::vector<DefObjInfo> objs;
|
2007-07-03 11:10:37 +03:00
|
|
|
void load();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //COBJINFOECTHANDLER_H
|