global.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. #endif
  11. #define NAME_VER ("VCMI \"Altanatse\" 0.7")
  12. enum Ecolor {RED, BLUE, TAN, GREEN, ORANGE, PURPLE, TEAL, PINK}; //player's colors
  13. enum EterrainType {border=-1, dirt, sand, grass, snow, swamp, rough, subterranean, lava, water, rock};
  14. enum Eriver {noRiver=0, clearRiver, icyRiver, muddyRiver, lavaRiver};
  15. enum Eroad {dirtRoad=1, grazvelRoad, cobblestoneRoad};
  16. enum Eformat { WoG=0x33, AB=0x15, RoE=0x0e, SoD=0x1c};
  17. enum EvictoryConditions {artifact, gatherTroop, gatherResource, buildCity, buildGrail, beatHero,
  18. captureCity, beatMonster, takeDwellings, takeMines, transportItem, winStandard=255};
  19. enum ElossCon {lossCastle, lossHero, timeExpires, lossStandard=255};
  20. enum EHeroClasses {HERO_KNIGHT, HERO_CLERIC, HERO_RANGER, HERO_DRUID, HERO_ALCHEMIST, HERO_WIZARD,
  21. HERO_DEMONIAC, HERO_HERETIC, HERO_DEATHKNIGHT, HERO_NECROMANCER, HERO_WARLOCK, HERO_OVERLORD,
  22. HERO_BARBARIAN, HERO_BATTLEMAGE, HERO_BEASTMASTER, HERO_WITCH, HERO_PLANESWALKER, HERO_ELEMENTALIST};
  23. class CGameInfo;
  24. extern CGameInfo* CGI;
  25. #define CURPLINT (((CPlayerInterface*)((CGI)->playerint[(CGI)->state->currentPlayer])))
  26. #define LOCPLINT (((CPlayerInterface*)((CGI)->playerint[(CGI)->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 SKILL_PER_HERO=8;
  36. const int ARTIFACTS_QUANTITY=171;
  37. const int HEROES_QUANTITY=156;
  38. const int SPELLS_QUANTITY=70;
  39. const int RESOURCE_QUANTITY=8;
  40. const int TERRAIN_TYPES=10;
  41. const int PRIMARY_SKILLS=4;
  42. const int NEUTRAL_PLAYER=255;
  43. const int NAMES_PER_TOWN=16;
  44. const int CREATURES_PER_TOWN = 7; //without upgrades
  45. const int MAX_BUILDING_PER_TURN = 1;
  46. #define MARK_BLOCKED_POSITIONS false
  47. #define MARK_VISITABLE_POSITIONS false
  48. #define DEFBYPASS
  49. #ifdef _WIN32
  50. #ifdef VCMI_DLL
  51. #define DLL_EXPORT __declspec(dllexport)
  52. #else
  53. #define DLL_EXPORT __declspec(dllimport)
  54. #endif
  55. #else
  56. #if defined(__GNUC__) && __GNUC__ >= 4
  57. #define DLL_EXPORT __attribute__ ((visibility("default")))
  58. #else
  59. #define DLL_EXPORT
  60. #endif
  61. #endif
  62. #define HANDLE_EXCEPTION \
  63. catch (const std::exception& e) { \
  64. std::cerr << e.what() << std::endl; \
  65. } \
  66. catch (const std::exception * e) \
  67. { \
  68. std::cerr << e->what()<< std::endl; \
  69. delete e; \
  70. }
  71. #endif //GLOBAL_H