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