2007-06-06 16:12:12 +00:00
|
|
|
#ifndef GLOBAL_H
|
|
|
|
#define GLOBAL_H
|
2007-06-07 13:43:30 +00:00
|
|
|
#define CHECKTIME 1
|
|
|
|
#if CHECKTIME
|
|
|
|
#include "timeHandler.h"
|
2007-11-18 22:58:28 +00:00
|
|
|
#include <boost/logic/tribool.hpp>
|
2007-06-07 13:43:30 +00:00
|
|
|
#include <iostream>
|
2008-02-24 23:06:27 +00:00
|
|
|
#include "int3.h"
|
2007-06-07 13:43:30 +00:00
|
|
|
#define THC
|
|
|
|
#else
|
|
|
|
#define THC //
|
|
|
|
#endif
|
2007-08-06 13:09:41 +00:00
|
|
|
enum Ecolor {RED, BLUE, TAN, GREEN, ORANGE, PURPLE, TEAL, PINK}; //player's colors
|
2007-08-08 19:28:56 +00:00
|
|
|
enum EterrainType {border=-1, dirt, sand, grass, snow, swamp, rough, subterranean, lava, water, rock};
|
2007-07-31 13:09:34 +00:00
|
|
|
enum Eriver {noRiver=0, clearRiver, icyRiver, muddyRiver, lavaRiver};
|
2007-06-18 20:05:42 +00:00
|
|
|
enum Eroad {dirtRoad=1, grazvelRoad, cobblestoneRoad};
|
2007-06-06 16:12:12 +00:00
|
|
|
enum Eformat { WoG=0x33, AB=0x15, RoE=0x0e, SoD=0x1c};
|
|
|
|
enum EvictoryConditions {artifact, gatherTroop, gatherResource, buildCity, buildGrail, beatHero,
|
2007-07-28 23:01:25 +00:00
|
|
|
captureCity, beatMonster, takeDwellings, takeMines, transportItem, winStandard=255};
|
2007-06-06 16:12:12 +00:00
|
|
|
enum ElossCon {lossCastle, lossHero, timeExpires, lossStandard=255};
|
2007-08-15 15:13:11 +00:00
|
|
|
enum EHeroClasses {HERO_KNIGHT, HERO_CLERIC, HERO_RANGER, HERO_DRUID, HERO_ALCHEMIST, HERO_WIZARD,
|
2007-07-28 23:01:25 +00:00
|
|
|
HERO_DEMONIAC, HERO_HERETIC, HERO_DEATHKNIGHT, HERO_NECROMANCER, HERO_WARLOCK, HERO_OVERLORD,
|
|
|
|
HERO_BARBARIAN, HERO_BATTLEMAGE, HERO_BEASTMASTER, HERO_WITCH, HERO_PLANESWALKER, HERO_ELEMENTALIST};
|
2007-08-06 04:03:34 +00:00
|
|
|
|
2008-02-10 09:35:52 +00:00
|
|
|
#ifdef _DEBUG
|
|
|
|
class CGameInfo;
|
|
|
|
extern CGameInfo* CGI;
|
|
|
|
#else
|
2007-08-19 21:12:55 +00:00
|
|
|
#define CGI (CGameInfo::mainObj)
|
2008-02-10 09:35:52 +00:00
|
|
|
#endif
|
2007-08-19 21:12:55 +00:00
|
|
|
#define CURPLINT (((CPlayerInterface*)((CGameInfo::mainObj)->playerint[(CGameInfo::mainObj)->state->currentPlayer])))
|
|
|
|
#define LOCPLINT (((CPlayerInterface*)((CGameInfo::mainObj)->playerint[(CGameInfo::mainObj)->localPlayer])))
|
2007-08-06 04:03:34 +00:00
|
|
|
//CURPLINT gives pointer to the interface of human player which is currently making turn,
|
|
|
|
//LOCPLINT gives pointer to the interface which is currently showed (on this machine)
|
|
|
|
|
2007-09-30 16:16:00 +00:00
|
|
|
#define HEROI_TYPE (0)
|
|
|
|
#define TOWNI_TYPE (1)
|
2007-09-14 13:11:10 +00:00
|
|
|
|
2007-12-06 18:32:06 +00:00
|
|
|
//#define LOGUJ
|
|
|
|
|
|
|
|
#ifdef LOGUJ
|
|
|
|
#define LOG(x) std::cout<<x;
|
|
|
|
#define LOGE(x) std::cout<<x<<std::endl;
|
|
|
|
#else
|
|
|
|
#define LOG(x) ;
|
|
|
|
#define LOGE(x) ;
|
|
|
|
#endif
|
2007-08-06 04:03:34 +00:00
|
|
|
|
2007-08-06 13:09:41 +00:00
|
|
|
const int F_NUMBER = 9; //factions (town types) quantity
|
2007-07-17 20:51:49 +00:00
|
|
|
const int PLAYER_LIMIT = 8; //player limit per map
|
2007-07-24 00:25:46 +00:00
|
|
|
const int HEROES_PER_TYPE=8; //amount of heroes of each type
|
2007-08-04 19:01:22 +00:00
|
|
|
const int SKILL_QUANTITY=28;
|
|
|
|
const int ARTIFACTS_QUANTITY=171;
|
|
|
|
const int HEROES_QUANTITY=156;
|
2007-09-16 17:21:23 +00:00
|
|
|
const int RESOURCE_QUANTITY=8;
|
2007-08-19 21:12:55 +00:00
|
|
|
const int TERRAIN_TYPES=10;
|
2007-09-14 13:11:10 +00:00
|
|
|
const int PRIMARY_SKILLS=4;
|
2007-11-24 14:17:57 +00:00
|
|
|
const int NEUTRAL_PLAYER=255;
|
2007-09-16 17:21:23 +00:00
|
|
|
const int NAMES_PER_TOWN=16;
|
2008-01-09 19:59:23 +00:00
|
|
|
const int CREATURES_PER_TOWN = 7; //without upgrades
|
2008-01-12 11:32:40 +00:00
|
|
|
const int MAX_BUILDING_PER_TURN = 1;
|
2007-09-16 17:21:23 +00:00
|
|
|
|
2007-08-11 14:58:07 +00:00
|
|
|
#define MARK_BLOCKED_POSITIONS false
|
|
|
|
#define MARK_VISITABLE_POSITIONS false
|
|
|
|
|
2007-06-06 16:12:12 +00:00
|
|
|
#define DEFBYPASS
|
2007-08-19 21:12:55 +00:00
|
|
|
|
2008-02-10 09:35:52 +00:00
|
|
|
|
2007-11-18 22:58:28 +00:00
|
|
|
#define HANDLE_EXCEPTION \
|
|
|
|
catch (const std::exception& e) { \
|
|
|
|
std::cerr << e.what() << std::endl; \
|
|
|
|
} \
|
|
|
|
catch (const std::exception * e) \
|
|
|
|
{ \
|
|
|
|
std::cerr << e->what()<< std::endl; \
|
|
|
|
delete e; \
|
|
|
|
}
|
|
|
|
|
2007-06-06 16:12:12 +00:00
|
|
|
#endif //GLOBAL_H
|