global.h 2.9 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. 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. class CGameInfo;
  25. extern CGameInfo* CGI;
  26. #define CURPLINT (((CPlayerInterface*)((CGI)->playerint[(CGI)->state->currentPlayer])))
  27. #define LOCPLINT (((CPlayerInterface*)((CGI)->playerint[(CGI)->localPlayer])))
  28. //CURPLINT gives pointer to the interface of human player which is currently making turn,
  29. //LOCPLINT gives pointer to the interface which is currently showed (on this machine)
  30. #define HEROI_TYPE (0)
  31. #define TOWNI_TYPE (1)
  32. //#define LOGUJ
  33. #ifdef LOGUJ
  34. #define LOG(x) std::cout<<x;
  35. #define LOGE(x) std::cout<<x<<std::endl;
  36. #else
  37. #define LOG(x) ;
  38. #define LOGE(x) ;
  39. #endif
  40. const int F_NUMBER = 9; //factions (town types) quantity
  41. const int PLAYER_LIMIT = 8; //player limit per map
  42. const int HEROES_PER_TYPE=8; //amount of heroes of each type
  43. const int SKILL_QUANTITY=28;
  44. const int SKILL_PER_HERO=8;
  45. const int ARTIFACTS_QUANTITY=171;
  46. const int HEROES_QUANTITY=156;
  47. const int SPELLS_QUANTITY=70;
  48. const int RESOURCE_QUANTITY=8;
  49. const int TERRAIN_TYPES=10;
  50. const int PRIMARY_SKILLS=4;
  51. const int NEUTRAL_PLAYER=255;
  52. const int NAMES_PER_TOWN=16;
  53. const int CREATURES_PER_TOWN = 7; //without upgrades
  54. const int MAX_BUILDING_PER_TURN = 1;
  55. #define MARK_BLOCKED_POSITIONS false
  56. #define MARK_VISITABLE_POSITIONS false
  57. #define DEFBYPASS
  58. #ifdef _WIN32
  59. #ifdef VCMI_DLL
  60. #define DLL_EXPORT __declspec(dllexport)
  61. #else
  62. #define DLL_EXPORT __declspec(dllimport)
  63. #endif
  64. #else
  65. #if defined(__GNUC__) && __GNUC__ >= 4
  66. #define DLL_EXPORT __attribute__ ((visibility("default")))
  67. #else
  68. #define DLL_EXPORT
  69. #endif
  70. #endif
  71. #define HANDLE_EXCEPTION \
  72. catch (const std::exception& e) { \
  73. std::cerr << e.what() << std::endl; \
  74. } \
  75. catch (const std::exception * e) \
  76. { \
  77. std::cerr << e->what()<< std::endl; \
  78. delete e; \
  79. }
  80. #endif //GLOBAL_H