/* * CMapGenerator.h, part of VCMI engine * * Authors: listed in file AUTHORS in main folder * * License: GNU General Public License v2.0 or later * Full text of license available in license.txt file, in main folder * */ #pragma once #include "../GameConstants.h" #include "../CRandomGenerator.h" #include "CMapGenOptions.h" #include "../int3.h" #include "CRmgTemplate.h" #include "../LoadProgress.h" class CRmgTemplate; class CMapGenOptions; class JsonNode; class RmgMap; class CMap; class Zone; typedef std::vector JsonVector; /// The map generator creates a map randomly. class DLL_LINKAGE CMapGenerator: public Load::Progress { public: struct Config { std::vector terrainUndergroundAllowed; std::vector terrainGroundProhibit; std::vector waterTreasure; int shipyardGuard; int mineExtraResources; int minGuardStrength; std::string defaultRoadType; int treasureValueLimit; std::vector prisonExperience, prisonValues; std::vector scrollValues; int pandoraMultiplierGold, pandoraMultiplierExperience, pandoraMultiplierSpells, pandoraSpellSchool, pandoraSpell60; std::vector pandoraCreatureValues; std::vector questValues, questRewardValues; }; explicit CMapGenerator(CMapGenOptions& mapGenOptions, int RandomSeed = std::time(nullptr)); ~CMapGenerator(); // required due to std::unique_ptr const Config & getConfig() const; CRandomGenerator rand; const CMapGenOptions& getMapGenOptions() const; std::unique_ptr generate(bool emptyMap = false); void findZonesForQuestArts(); int getNextMonlithIndex(); int getPrisonsRemaning() const; void decreasePrisonsRemaining(); const std::vector & getQuestArtsRemaning() const; void banQuestArt(ArtifactID id); Zone * getZoneWater() const; void createWaterTreasures(); int getRandomSeed() const; private: int randomSeed; CMapGenOptions& mapGenOptions; Config config; std::unique_ptr map; std::vector connectionsLeft; //std::pair zoneWater; int prisonsRemaining; //int questArtsRemaining; int monolithIndex; std::vector questArtifacts; /// Generation methods void loadConfig(); std::string getMapDescription() const; void initPrisonsRemaining(); void initQuestArtsRemaining(); void addPlayerInfo(); void addHeaderInfo(); void genZones(); void fillZones(); };