global.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 <iostream>
  8. #include "int3.h"
  9. #define THC
  10. #else
  11. #define THC //
  12. #endif
  13. #ifdef WIN32
  14. #define PATHSEPARATOR "\\"
  15. #define DATADIR ""
  16. #else
  17. #define PATHSEPARATOR "/"
  18. #define DATADIR "/progdir/"
  19. #endif
  20. enum Ecolor {RED, BLUE, TAN, GREEN, ORANGE, PURPLE, TEAL, PINK}; //player's colors
  21. enum EterrainType {border=-1, dirt, sand, grass, snow, swamp, rough, subterranean, lava, water, rock};
  22. enum Eriver {noRiver=0, clearRiver, icyRiver, muddyRiver, lavaRiver};
  23. enum Eroad {dirtRoad=1, grazvelRoad, cobblestoneRoad};
  24. enum Eformat { WoG=0x33, AB=0x15, RoE=0x0e, SoD=0x1c};
  25. enum EvictoryConditions {artifact, gatherTroop, gatherResource, buildCity, buildGrail, beatHero,
  26. captureCity, beatMonster, takeDwellings, takeMines, transportItem, winStandard=255};
  27. enum ElossCon {lossCastle, lossHero, timeExpires, lossStandard=255};
  28. enum EHeroClasses {HERO_KNIGHT, HERO_CLERIC, HERO_RANGER, HERO_DRUID, HERO_ALCHEMIST, HERO_WIZARD,
  29. HERO_DEMONIAC, HERO_HERETIC, HERO_DEATHKNIGHT, HERO_NECROMANCER, HERO_WARLOCK, HERO_OVERLORD,
  30. HERO_BARBARIAN, HERO_BATTLEMAGE, HERO_BEASTMASTER, HERO_WITCH, HERO_PLANESWALKER, HERO_ELEMENTALIST};
  31. #ifdef _DEBUG
  32. class CGameInfo;
  33. extern CGameInfo* CGI;
  34. #else
  35. #define CGI (CGameInfo::mainObj)
  36. #endif
  37. #define CURPLINT (((CPlayerInterface*)((CGameInfo::mainObj)->playerint[(CGameInfo::mainObj)->state->currentPlayer])))
  38. #define LOCPLINT (((CPlayerInterface*)((CGameInfo::mainObj)->playerint[(CGameInfo::mainObj)->localPlayer])))
  39. //CURPLINT gives pointer to the interface of human player which is currently making turn,
  40. //LOCPLINT gives pointer to the interface which is currently showed (on this machine)
  41. #define HEROI_TYPE (0)
  42. #define TOWNI_TYPE (1)
  43. //#define LOGUJ
  44. #ifdef LOGUJ
  45. #define LOG(x) std::cout<<x;
  46. #define LOGE(x) std::cout<<x<<std::endl;
  47. #else
  48. #define LOG(x) ;
  49. #define LOGE(x) ;
  50. #endif
  51. const int F_NUMBER = 9; //factions (town types) quantity
  52. const int PLAYER_LIMIT = 8; //player limit per map
  53. const int HEROES_PER_TYPE=8; //amount of heroes of each type
  54. const int SKILL_QUANTITY=28;
  55. const int SKILL_PER_HERO=8;
  56. const int ARTIFACTS_QUANTITY=171;
  57. const int HEROES_QUANTITY=156;
  58. const int RESOURCE_QUANTITY=8;
  59. const int TERRAIN_TYPES=10;
  60. const int PRIMARY_SKILLS=4;
  61. const int NEUTRAL_PLAYER=255;
  62. const int NAMES_PER_TOWN=16;
  63. const int CREATURES_PER_TOWN = 7; //without upgrades
  64. const int MAX_BUILDING_PER_TURN = 1;
  65. #define MARK_BLOCKED_POSITIONS false
  66. #define MARK_VISITABLE_POSITIONS false
  67. #define DEFBYPASS
  68. #define HANDLE_EXCEPTION \
  69. catch (const std::exception& e) { \
  70. std::cerr << e.what() << std::endl; \
  71. } \
  72. catch (const std::exception * e) \
  73. { \
  74. std::cerr << e->what()<< std::endl; \
  75. delete e; \
  76. }
  77. #endif //GLOBAL_H