global.h 2.4 KB

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