global.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. #ifdef _DEBUG
  25. class CGameInfo;
  26. extern CGameInfo* CGI;
  27. #else
  28. #define CGI (CGameInfo::mainObj)
  29. #endif
  30. #define CURPLINT (((CPlayerInterface*)((CGameInfo::mainObj)->playerint[(CGameInfo::mainObj)->state->currentPlayer])))
  31. #define LOCPLINT (((CPlayerInterface*)((CGameInfo::mainObj)->playerint[(CGameInfo::mainObj)->localPlayer])))
  32. //CURPLINT gives pointer to the interface of human player which is currently making turn,
  33. //LOCPLINT gives pointer to the interface which is currently showed (on this machine)
  34. #define HEROI_TYPE (0)
  35. #define TOWNI_TYPE (1)
  36. //#define LOGUJ
  37. #ifdef LOGUJ
  38. #define LOG(x) std::cout<<x;
  39. #define LOGE(x) std::cout<<x<<std::endl;
  40. #else
  41. #define LOG(x) ;
  42. #define LOGE(x) ;
  43. #endif
  44. const int F_NUMBER = 9; //factions (town types) quantity
  45. const int PLAYER_LIMIT = 8; //player limit per map
  46. const int HEROES_PER_TYPE=8; //amount of heroes of each type
  47. const int SKILL_QUANTITY=28;
  48. const int SKILL_PER_HERO=8;
  49. const int ARTIFACTS_QUANTITY=171;
  50. const int HEROES_QUANTITY=156;
  51. const int SPELLS_QUANTITY=70;
  52. const int RESOURCE_QUANTITY=8;
  53. const int TERRAIN_TYPES=10;
  54. const int PRIMARY_SKILLS=4;
  55. const int NEUTRAL_PLAYER=255;
  56. const int NAMES_PER_TOWN=16;
  57. const int CREATURES_PER_TOWN = 7; //without upgrades
  58. const int MAX_BUILDING_PER_TURN = 1;
  59. #define MARK_BLOCKED_POSITIONS false
  60. #define MARK_VISITABLE_POSITIONS false
  61. #define DEFBYPASS
  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