global.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. //#define LOGUJ
  32. #ifdef LOGUJ
  33. #define LOG(x) std::cout<<x;
  34. #define LOGE(x) std::cout<<x<<std::endl;
  35. #else
  36. #define LOG(x) ;
  37. #define LOGE(x) ;
  38. #endif
  39. const int F_NUMBER = 9; //factions (town types) quantity
  40. const int PLAYER_LIMIT = 8; //player limit per map
  41. const int HEROES_PER_TYPE=8; //amount of heroes of each type
  42. const int SKILL_QUANTITY=28;
  43. const int ARTIFACTS_QUANTITY=171;
  44. const int HEROES_QUANTITY=156;
  45. const int RESOURCE_QUANTITY=8;
  46. const int TERRAIN_TYPES=10;
  47. const int PRIMARY_SKILLS=4;
  48. const int NEUTRAL_PLAYER=255;
  49. const int NAMES_PER_TOWN=16;
  50. const int CREATURES_PER_TOWN = 7; //without upgrades
  51. const int MAX_BUILDING_PER_TURN = 1;
  52. #define MARK_BLOCKED_POSITIONS false
  53. #define MARK_VISITABLE_POSITIONS false
  54. #define DEFBYPASS
  55. #define HANDLE_EXCEPTION \
  56. catch (const std::exception& e) { \
  57. std::cerr << e.what() << std::endl; \
  58. } \
  59. catch (const std::exception * e) \
  60. { \
  61. std::cerr << e->what()<< std::endl; \
  62. delete e; \
  63. }
  64. #endif //GLOBAL_H