2013-01-06 19:30:12 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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 "../CRandomGenerator.h"
|
2013-08-17 12:46:48 +00:00
|
|
|
#include "CMapGenOptions.h"
|
2013-01-06 19:30:12 +00:00
|
|
|
|
|
|
|
class CMap;
|
|
|
|
class CMapEditManager;
|
2013-04-15 17:18:04 +00:00
|
|
|
|
2013-04-14 18:52:05 +00:00
|
|
|
/// The map generator creates a map randomly.
|
|
|
|
class DLL_LINKAGE CMapGenerator
|
2013-01-06 19:30:12 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-08-19 18:20:11 +00:00
|
|
|
CMapGenerator();
|
2013-04-14 19:24:31 +00:00
|
|
|
~CMapGenerator(); // required due to unique_ptr
|
2013-01-06 19:30:12 +00:00
|
|
|
|
2013-08-19 18:20:11 +00:00
|
|
|
std::unique_ptr<CMap> generate(CMapGenOptions * mapGenOptions, int randomSeed = std::time(nullptr));
|
2013-01-06 19:30:12 +00:00
|
|
|
|
|
|
|
private:
|
2013-04-14 19:24:31 +00:00
|
|
|
/// Generation methods
|
|
|
|
std::string getMapDescription() const;
|
|
|
|
void addPlayerInfo();
|
|
|
|
void addHeaderInfo();
|
2013-01-06 19:30:12 +00:00
|
|
|
void genTerrain();
|
|
|
|
void genTowns();
|
|
|
|
|
2013-08-19 18:20:11 +00:00
|
|
|
CMapGenOptions * mapGenOptions;
|
2013-01-06 19:30:12 +00:00
|
|
|
std::unique_ptr<CMap> map;
|
|
|
|
CRandomGenerator gen;
|
|
|
|
int randomSeed;
|
2013-04-19 11:43:11 +00:00
|
|
|
CMapEditManager * editManager;
|
2013-01-06 19:30:12 +00:00
|
|
|
};
|