1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Implemented road transitions.

* untested
* still unused
This commit is contained in:
AlexVinS
2015-01-03 05:03:44 +03:00
parent b1d4ce0474
commit ae2c72ca52
5 changed files with 239 additions and 21 deletions

View File

@@ -27,12 +27,30 @@ private:
struct RoadPattern
{
std::string rules[9];
std::string data[9];
std::pair<int, int> roadMapping, riverMapping;
bool hasHFlip, hasBFlip;
bool hasHFlip, hasVFlip;
};
static const std::vector<RoadPattern> rules;
struct ValidationResult
{
ValidationResult(bool result): result(result), flip(0){};
bool result;
int flip;
};
static const std::vector<RoadPattern> patterns;
void flipPattern(RoadPattern & pattern, int flip) const;
void updateTiles(std::set<int3> & invalidated);
ValidationResult validateTile(const RoadPattern & pattern, const int3 & pos);
void updateTile(TerrainTile & tile, const RoadPattern & pattern, const int flip);
bool canApplyPattern(const RoadPattern & pattern) const;
bool needUpdateTile(const TerrainTile & tile) const;
bool tileHasSomething(const int3 & pos) const;
CTerrainSelection terrainSel;
ERoadType::ERoadType roadType;