CRmgTemplateZone.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. * CRmgTemplateZone.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "../GameConstants.h"
  12. namespace ETemplateZoneType
  13. {
  14. enum ETemplateZoneType
  15. {
  16. PLAYER_START,
  17. CPU_START,
  18. TREASURE,
  19. JUNCTION
  20. };
  21. }
  22. /// The CRmgTemplateZone describes a zone in a template.
  23. class DLL_LINKAGE CRmgTemplateZone
  24. {
  25. public:
  26. class DLL_LINKAGE CTownInfo
  27. {
  28. public:
  29. CTownInfo();
  30. int getTownCount() const; /// Default: 0
  31. void setTownCount(int value);
  32. int getCastleCount() const; /// Default: 0
  33. void setCastleCount(int value);
  34. int getTownDensity() const; /// Default: 0
  35. void setTownDensity(int value);
  36. int getCastleDensity() const; /// Default: 0
  37. void setCastleDensity(int value);
  38. private:
  39. int townCount, castleCount, townDensity, castleDensity;
  40. };
  41. CRmgTemplateZone();
  42. TRmgTemplateZoneId getId() const; /// Default: 0
  43. void setId(TRmgTemplateZoneId value);
  44. ETemplateZoneType::ETemplateZoneType getType() const; /// Default: ETemplateZoneType::PLAYER_START
  45. void setType(ETemplateZoneType::ETemplateZoneType value);
  46. int getSize() const; /// Default: 1
  47. void setSize(int value);
  48. boost::optional<int> getOwner() const;
  49. void setOwner(boost::optional<int> value);
  50. const CTownInfo & getPlayerTowns() const;
  51. void setPlayerTowns(const CTownInfo & value);
  52. const CTownInfo & getNeutralTowns() const;
  53. void setNeutralTowns(const CTownInfo & value);
  54. bool getTownsAreSameType() const; /// Default: false
  55. void setTownsAreSameType(bool value);
  56. const std::set<TFaction> & getTownTypes() const; /// Default: all
  57. void setTownTypes(const std::set<TFaction> & value);
  58. std::set<TFaction> getDefaultTownTypes() const;
  59. bool getMatchTerrainToTown() const; /// Default: true
  60. void setMatchTerrainToTown(bool value);
  61. const std::set<ETerrainType> & getTerrainTypes() const; /// Default: all
  62. void setTerrainTypes(const std::set<ETerrainType> & value);
  63. std::set<ETerrainType> getDefaultTerrainTypes() const;
  64. boost::optional<TRmgTemplateZoneId> getTerrainTypeLikeZone() const;
  65. void setTerrainTypeLikeZone(boost::optional<TRmgTemplateZoneId> value);
  66. boost::optional<TRmgTemplateZoneId> getTownTypeLikeZone() const;
  67. void setTownTypeLikeZone(boost::optional<TRmgTemplateZoneId> value);
  68. private:
  69. TRmgTemplateZoneId id;
  70. ETemplateZoneType::ETemplateZoneType type;
  71. int size;
  72. boost::optional<int> owner;
  73. CTownInfo playerTowns, neutralTowns;
  74. bool townsAreSameType;
  75. std::set<TFaction> townTypes;
  76. bool matchTerrainToTown;
  77. std::set<ETerrainType> terrainTypes;
  78. boost::optional<TRmgTemplateZoneId> terrainTypeLikeZone, townTypeLikeZone;
  79. };