CMapGenerator.h 896 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * CMapGenerator.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 "../CRandomGenerator.h"
  12. #include "CMapGenOptions.h"
  13. class CMap;
  14. class CMapEditManager;
  15. /// The map generator creates a map randomly.
  16. class DLL_LINKAGE CMapGenerator
  17. {
  18. public:
  19. CMapGenerator();
  20. ~CMapGenerator(); // required due to unique_ptr
  21. std::unique_ptr<CMap> generate(CMapGenOptions * mapGenOptions, int randomSeed = std::time(nullptr));
  22. private:
  23. /// Generation methods
  24. std::string getMapDescription() const;
  25. void addPlayerInfo();
  26. void addHeaderInfo();
  27. void genTerrain();
  28. void genTowns();
  29. CMapGenOptions * mapGenOptions;
  30. std::unique_ptr<CMap> map;
  31. CRandomGenerator gen;
  32. int randomSeed;
  33. CMapEditManager * editManager;
  34. };