CvMapGenerator.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #pragma once
  2. #ifndef CIV4_MAPGENERATOR_H
  3. #define CIV4_MAPGENERATOR_H
  4. //#include "CvEnums.h"
  5. #pragma warning( disable: 4251 ) // needs to have dll-interface to be used by clients of class
  6. class CvFractal;
  7. class CvPlot;
  8. class CvArea;
  9. class CvMapGenerator
  10. {
  11. public:
  12. DllExport static CvMapGenerator& GetInstance();
  13. DllExport static void FreeInstance() { SAFE_DELETE(m_pInst); }
  14. DllExport CvMapGenerator();
  15. DllExport virtual ~CvMapGenerator();
  16. bool canPlaceBonusAt(BonusTypes eBonus, int iX, int iY, bool bIgnoreLatitude); // Exposed to Python
  17. bool canPlaceGoodyAt(ImprovementTypes eImprovement, int iX, int iY); // Exposed to Python
  18. // does all of the below "add..." functions:
  19. DllExport void addGameElements(); // Exposed to Python
  20. void addLakes(); // Exposed to Python
  21. DllExport void addRivers(); // Exposed to Python
  22. void doRiver(CvPlot* pStartPlot, CardinalDirectionTypes eLastCardinalDirection=NO_CARDINALDIRECTION, CardinalDirectionTypes eOriginalCardinalDirection=NO_CARDINALDIRECTION, int iThisRiverID=-1); // Exposed to Python
  23. bool addRiver(CvPlot *pFreshWaterPlot);
  24. DllExport void addFeatures(); // Exposed to Python
  25. DllExport void addBonuses(); // Exposed to Python
  26. void addUniqueBonusType(BonusTypes eBonusType); // Exposed to Python
  27. void addNonUniqueBonusType(BonusTypes eBonusType); // Exposed to Python
  28. DllExport void addGoodies(); // Exposed to Python
  29. //FfH: Added by Kael 10/04/2008
  30. DllExport void addImprovements(); // Exposed to Python
  31. DllExport void addUniqueImprovements(); // Exposed to Python
  32. //FfH: End Add
  33. DllExport void eraseRivers(); // Exposed to Python
  34. DllExport void eraseFeatures(); // Exposed to Python
  35. DllExport void eraseBonuses(); // Exposed to Python
  36. DllExport void eraseGoodies(); // Exposed to Python
  37. DllExport void generateRandomMap(); // Exposed to Python
  38. void generatePlotTypes(); // Exposed to Python
  39. void generateTerrain(); // Exposed to Python
  40. void afterGeneration(); // Exposed to Python
  41. void setPlotTypes(const int* paiPlotTypes); // Exposed to Python
  42. protected:
  43. // Utility functions for roughenHeights()
  44. int getRiverValueAtPlot(CvPlot* pPlot);
  45. int calculateNumBonusesToAdd(BonusTypes eBonusType);
  46. private:
  47. static CvMapGenerator* m_pInst;
  48. };
  49. #endif