mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Add townHints to random template, define logic
This commit is contained in:
@@ -142,7 +142,22 @@ public:
|
||||
int castleDensity;
|
||||
|
||||
// TODO: Copy from another zone once its randomized
|
||||
TRmgTemplateZoneId sourceZone = NO_ZONE;
|
||||
|
||||
TRmgTemplateZoneId townTypesLikeZone = NO_ZONE;
|
||||
TRmgTemplateZoneId townTypesNotLikeZone = NO_ZONE;
|
||||
TRmgTemplateZoneId townTypesRelatedToZoneTerrain = NO_ZONE;
|
||||
};
|
||||
|
||||
class DLL_LINKAGE CTownHints
|
||||
{
|
||||
public:
|
||||
CTownHints();
|
||||
// TODO: Make private
|
||||
TRmgTemplateZoneId likeZone = NO_ZONE;
|
||||
TRmgTemplateZoneId notLikeZone = NO_ZONE;
|
||||
TRmgTemplateZoneId relatedToZoneTerrain = NO_ZONE;
|
||||
|
||||
void serializeJson(JsonSerializeFormat & handler);
|
||||
};
|
||||
|
||||
ZoneOptions();
|
||||
@@ -162,12 +177,21 @@ public:
|
||||
std::set<TerrainId> getDefaultTerrainTypes() const;
|
||||
|
||||
const CTownInfo & getPlayerTowns() const;
|
||||
void setPlayerTowns(const CTownInfo & value);
|
||||
const CTownInfo & getNeutralTowns() const;
|
||||
std::set<FactionID> getDefaultTownTypes() const;
|
||||
void setNeutralTowns(const CTownInfo & value);
|
||||
bool isMatchTerrainToTown() const;
|
||||
void setMatchTerrainToTown(bool value);
|
||||
const std::vector<CTownHints> & getTownHints() const;
|
||||
void setTownHints(const std::vector<CTownHints> & value);
|
||||
std::set<FactionID> getTownTypes() const;
|
||||
void setTownTypes(const std::set<FactionID> & value);
|
||||
std::set<FactionID> getBannedTownTypes() const;
|
||||
void setBannedTownTypes(const std::set<FactionID> & value);
|
||||
|
||||
std::set<FactionID> getDefaultTownTypes() const;
|
||||
std::set<FactionID> getMonsterTypes() const;
|
||||
|
||||
void setTownTypes(const std::set<FactionID> & value);
|
||||
void setMonsterTypes(const std::set<FactionID> & value);
|
||||
|
||||
void setMinesInfo(const std::map<TResource, ui16> & value);
|
||||
@@ -192,7 +216,6 @@ public:
|
||||
EMonsterStrength::EMonsterStrength monsterStrength;
|
||||
|
||||
bool areTownsSameType() const;
|
||||
bool isMatchTerrainToTown() const;
|
||||
|
||||
// Get a group of configured objects
|
||||
const std::vector<CompoundMapObjectID> & getBannedObjects() const;
|
||||
@@ -202,7 +225,8 @@ public:
|
||||
// Copy whole custom object config from another zone
|
||||
ObjectConfig getCustomObjects() const;
|
||||
void setCustomObjects(const ObjectConfig & value);
|
||||
TRmgTemplateZoneId getCustomObjectsLikeZone() const;
|
||||
TRmgTemplateZoneId getCustomObjectsLikeZone() const;
|
||||
TRmgTemplateZoneId getTownsLikeZone() const;
|
||||
|
||||
protected:
|
||||
TRmgTemplateZoneId id;
|
||||
@@ -218,6 +242,7 @@ protected:
|
||||
std::set<TerrainId> terrainTypes;
|
||||
std::set<TerrainId> bannedTerrains;
|
||||
bool townsAreSameType;
|
||||
std::vector<CTownHints> townHints; // For every town present on map
|
||||
|
||||
std::set<FactionID> townTypes;
|
||||
std::set<FactionID> bannedTownTypes;
|
||||
@@ -231,6 +256,7 @@ protected:
|
||||
std::vector<TRmgTemplateZoneId> connectedZoneIds; //list of adjacent zone ids
|
||||
std::vector<ZoneConnection> connectionDetails; //list of connections linked to that zone
|
||||
|
||||
TRmgTemplateZoneId townsLikeZone;
|
||||
TRmgTemplateZoneId minesLikeZone;
|
||||
TRmgTemplateZoneId terrainTypeLikeZone;
|
||||
TRmgTemplateZoneId treasureLikeZone;
|
||||
@@ -305,8 +331,7 @@ private:
|
||||
std::map<TResource, ui16> inheritMineTypes(std::shared_ptr<rmg::ZoneOptions> zone, uint32_t iteration = 0);
|
||||
std::vector<CTreasureInfo> inheritTreasureInfo(std::shared_ptr<rmg::ZoneOptions> zone, uint32_t iteration = 0);
|
||||
|
||||
// TODO: Copy custom object settings
|
||||
// TODO: Copy town type after source town is actually randomized
|
||||
void inheritTownProperties(std::shared_ptr<rmg::ZoneOptions> zone, uint32_t iteration = 0);
|
||||
|
||||
void serializeSize(JsonSerializeFormat & handler, int3 & value, const std::string & fieldName);
|
||||
void serializePlayers(JsonSerializeFormat & handler, CPlayerCountRange & value, const std::string & fieldName);
|
||||
|
||||
Reference in New Issue
Block a user