|
@@ -14,7 +14,7 @@
|
|
|
#include "CMapGenerator.h"
|
|
#include "CMapGenerator.h"
|
|
|
#include "float3.h"
|
|
#include "float3.h"
|
|
|
#include "../int3.h"
|
|
#include "../int3.h"
|
|
|
-#include "../ResourceSet.h" //for TResource (?)
|
|
|
|
|
|
|
+#include "CRmgTemplate.h"
|
|
|
#include "../mapObjects/ObjectTemplate.h"
|
|
#include "../mapObjects/ObjectTemplate.h"
|
|
|
#include <boost/heap/priority_queue.hpp> //A*
|
|
#include <boost/heap/priority_queue.hpp> //A*
|
|
|
|
|
|
|
@@ -23,18 +23,7 @@ class CTileInfo;
|
|
|
class int3;
|
|
class int3;
|
|
|
class CGObjectInstance;
|
|
class CGObjectInstance;
|
|
|
class ObjectTemplate;
|
|
class ObjectTemplate;
|
|
|
-class CRmgTemplateZoneConnection;
|
|
|
|
|
|
|
|
|
|
-namespace ETemplateZoneType
|
|
|
|
|
-{
|
|
|
|
|
- enum ETemplateZoneType
|
|
|
|
|
- {
|
|
|
|
|
- PLAYER_START,
|
|
|
|
|
- CPU_START,
|
|
|
|
|
- TREASURE,
|
|
|
|
|
- JUNCTION
|
|
|
|
|
- };
|
|
|
|
|
-}
|
|
|
|
|
namespace EObjectPlacingResult
|
|
namespace EObjectPlacingResult
|
|
|
{
|
|
{
|
|
|
enum EObjectPlacingResult
|
|
enum EObjectPlacingResult
|
|
@@ -71,14 +60,6 @@ private:
|
|
|
ERoadType::ERoadType roadType;
|
|
ERoadType::ERoadType roadType;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-class DLL_LINKAGE CTreasureInfo
|
|
|
|
|
-{
|
|
|
|
|
-public:
|
|
|
|
|
- ui32 min;
|
|
|
|
|
- ui32 max;
|
|
|
|
|
- ui16 density;
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
struct DLL_LINKAGE ObjectInfo
|
|
struct DLL_LINKAGE ObjectInfo
|
|
|
{
|
|
{
|
|
|
ObjectTemplate templ;
|
|
ObjectTemplate templ;
|
|
@@ -105,57 +86,14 @@ struct DLL_LINKAGE CTreasurePileInfo
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/// The CRmgTemplateZone describes a zone in a template.
|
|
/// The CRmgTemplateZone describes a zone in a template.
|
|
|
-class DLL_LINKAGE CRmgTemplateZone
|
|
|
|
|
|
|
+class DLL_LINKAGE CRmgTemplateZone : public rmg::ZoneOptions
|
|
|
{
|
|
{
|
|
|
public:
|
|
public:
|
|
|
- class DLL_LINKAGE CTownInfo
|
|
|
|
|
- {
|
|
|
|
|
- public:
|
|
|
|
|
- CTownInfo();
|
|
|
|
|
-
|
|
|
|
|
- int getTownCount() const; /// Default: 0
|
|
|
|
|
- void setTownCount(int value);
|
|
|
|
|
- int getCastleCount() const; /// Default: 0
|
|
|
|
|
- void setCastleCount(int value);
|
|
|
|
|
- int getTownDensity() const; /// Default: 0
|
|
|
|
|
- void setTownDensity(int value);
|
|
|
|
|
- int getCastleDensity() const; /// Default: 0
|
|
|
|
|
- void setCastleDensity(int value);
|
|
|
|
|
-
|
|
|
|
|
- private:
|
|
|
|
|
- int townCount, castleCount, townDensity, castleDensity;
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
CRmgTemplateZone();
|
|
CRmgTemplateZone();
|
|
|
|
|
|
|
|
- void setGenPtr(CMapGenerator * Gen);
|
|
|
|
|
|
|
+ void setOptions(const rmg::ZoneOptions * options);
|
|
|
|
|
|
|
|
- TRmgTemplateZoneId getId() const; /// Default: 0
|
|
|
|
|
- void setId(TRmgTemplateZoneId value);
|
|
|
|
|
- ETemplateZoneType::ETemplateZoneType getType() const; /// Default: ETemplateZoneType::PLAYER_START
|
|
|
|
|
- void setType(ETemplateZoneType::ETemplateZoneType value);
|
|
|
|
|
- int getSize() const; /// Default: 1
|
|
|
|
|
- void setSize(int value);
|
|
|
|
|
- boost::optional<int> getOwner() const;
|
|
|
|
|
- void setOwner(boost::optional<int> value);
|
|
|
|
|
- const CTownInfo & getPlayerTowns() const;
|
|
|
|
|
- void setPlayerTowns(const CTownInfo & value);
|
|
|
|
|
- const CTownInfo & getNeutralTowns() const;
|
|
|
|
|
- void setNeutralTowns(const CTownInfo & value);
|
|
|
|
|
- bool getTownsAreSameType() const; /// Default: false
|
|
|
|
|
- void setTownsAreSameType(bool value);
|
|
|
|
|
- const std::set<TFaction> & getTownTypes() const; /// Default: all
|
|
|
|
|
- void setTownTypes(const std::set<TFaction> & value);
|
|
|
|
|
- void setMonsterTypes(const std::set<TFaction> & value);
|
|
|
|
|
- std::set<TFaction> getDefaultTownTypes() const;
|
|
|
|
|
- bool getMatchTerrainToTown() const; /// Default: true
|
|
|
|
|
- void setMatchTerrainToTown(bool value);
|
|
|
|
|
- const std::set<ETerrainType> & getTerrainTypes() const; /// Default: all
|
|
|
|
|
- void setTerrainTypes(const std::set<ETerrainType> & value);
|
|
|
|
|
- std::set<ETerrainType> getDefaultTerrainTypes() const;
|
|
|
|
|
- void setMinesAmount (TResource res, ui16 amount);
|
|
|
|
|
- std::map<TResource, ui16> getMinesInfo() const;
|
|
|
|
|
- void setMonsterStrength (EMonsterStrength::EMonsterStrength val);
|
|
|
|
|
|
|
+ void setGenPtr(CMapGenerator * Gen);
|
|
|
|
|
|
|
|
float3 getCenter() const;
|
|
float3 getCenter() const;
|
|
|
void setCenter(const float3 &f);
|
|
void setCenter(const float3 &f);
|
|
@@ -198,11 +136,8 @@ public:
|
|
|
std::vector<int3> getAccessibleOffsets (const CGObjectInstance* object);
|
|
std::vector<int3> getAccessibleOffsets (const CGObjectInstance* object);
|
|
|
bool areAllTilesAvailable(CGObjectInstance* obj, int3& tile, std::set<int3>& tilesBlockedByObject) const;
|
|
bool areAllTilesAvailable(CGObjectInstance* obj, int3& tile, std::set<int3>& tilesBlockedByObject) const;
|
|
|
|
|
|
|
|
- void addConnection(TRmgTemplateZoneId otherZone);
|
|
|
|
|
void setQuestArtZone(CRmgTemplateZone * otherZone);
|
|
void setQuestArtZone(CRmgTemplateZone * otherZone);
|
|
|
std::vector<TRmgTemplateZoneId> getConnections() const;
|
|
std::vector<TRmgTemplateZoneId> getConnections() const;
|
|
|
- void addTreasureInfo(CTreasureInfo & info);
|
|
|
|
|
- std::vector<CTreasureInfo> getTreasureInfo();
|
|
|
|
|
std::set<int3>* getFreePaths();
|
|
std::set<int3>* getFreePaths();
|
|
|
|
|
|
|
|
ObjectInfo getRandomObject (CTreasurePileInfo &info, ui32 desiredValue, ui32 maxValue, ui32 currentValue);
|
|
ObjectInfo getRandomObject (CTreasurePileInfo &info, ui32 desiredValue, ui32 maxValue, ui32 currentValue);
|
|
@@ -226,27 +161,13 @@ public:
|
|
|
boost::heap::priority_queue<TDistance, boost::heap::compare<NodeComparer>> createPiorityQueue();
|
|
boost::heap::priority_queue<TDistance, boost::heap::compare<NodeComparer>> createPiorityQueue();
|
|
|
|
|
|
|
|
private:
|
|
private:
|
|
|
-
|
|
|
|
|
CMapGenerator * gen;
|
|
CMapGenerator * gen;
|
|
|
//template info
|
|
//template info
|
|
|
- TRmgTemplateZoneId id;
|
|
|
|
|
- ETemplateZoneType::ETemplateZoneType type;
|
|
|
|
|
- int size;
|
|
|
|
|
- boost::optional<int> owner;
|
|
|
|
|
- CTownInfo playerTowns, neutralTowns;
|
|
|
|
|
- bool townsAreSameType;
|
|
|
|
|
- std::set<TFaction> townTypes;
|
|
|
|
|
- std::set<TFaction> monsterTypes;
|
|
|
|
|
- bool matchTerrainToTown;
|
|
|
|
|
- std::set<ETerrainType> terrainTypes;
|
|
|
|
|
- std::map<TResource, ui16> mines; //obligatory mines to spawn in this zone
|
|
|
|
|
|
|
|
|
|
si32 townType;
|
|
si32 townType;
|
|
|
ETerrainType terrainType;
|
|
ETerrainType terrainType;
|
|
|
CRmgTemplateZone * questArtZone; //artifacts required for Seer Huts will be placed here - or not if null
|
|
CRmgTemplateZone * questArtZone; //artifacts required for Seer Huts will be placed here - or not if null
|
|
|
|
|
|
|
|
- EMonsterStrength::EMonsterStrength zoneMonsterStrength;
|
|
|
|
|
- std::vector<CTreasureInfo> treasureInfo;
|
|
|
|
|
std::vector<ObjectInfo> possibleObjects;
|
|
std::vector<ObjectInfo> possibleObjects;
|
|
|
int minGuardedValue;
|
|
int minGuardedValue;
|
|
|
|
|
|
|
@@ -260,7 +181,6 @@ private:
|
|
|
float3 center;
|
|
float3 center;
|
|
|
std::set<int3> tileinfo; //irregular area assined to zone
|
|
std::set<int3> tileinfo; //irregular area assined to zone
|
|
|
std::set<int3> possibleTiles; //optimization purposes for treasure generation
|
|
std::set<int3> possibleTiles; //optimization purposes for treasure generation
|
|
|
- std::vector<TRmgTemplateZoneId> connections; //list of adjacent zones
|
|
|
|
|
std::set<int3> freePaths; //core paths of free tiles that all other objects will be linked to
|
|
std::set<int3> freePaths; //core paths of free tiles that all other objects will be linked to
|
|
|
|
|
|
|
|
std::set<int3> roadNodes; //tiles to be connected with roads
|
|
std::set<int3> roadNodes; //tiles to be connected with roads
|