1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

New terrain support - part 1 (#755)

Initial support of new terrains
This commit is contained in:
Nordsoft91
2022-06-20 17:39:50 +03:00
committed by Andrii Danylchenko
parent 5862c192b0
commit 08ecf4cf4c
103 changed files with 1066 additions and 1472 deletions

View File

@ -236,38 +236,6 @@ std::ostream & operator<<(std::ostream & os, const EActionType actionType)
else return os << it->second;
}
std::ostream & operator<<(std::ostream & os, const ETerrainType terrainType)
{
static const std::map<ETerrainType::EETerrainType, std::string> terrainTypeToString =
{
#define DEFINE_ELEMENT(element) {ETerrainType::element, #element}
DEFINE_ELEMENT(WRONG),
DEFINE_ELEMENT(BORDER),
DEFINE_ELEMENT(DIRT),
DEFINE_ELEMENT(SAND),
DEFINE_ELEMENT(GRASS),
DEFINE_ELEMENT(SNOW),
DEFINE_ELEMENT(SWAMP),
DEFINE_ELEMENT(ROUGH),
DEFINE_ELEMENT(SUBTERRANEAN),
DEFINE_ELEMENT(LAVA),
DEFINE_ELEMENT(WATER),
DEFINE_ELEMENT(ROCK)
#undef DEFINE_ELEMENT
};
auto it = terrainTypeToString.find(terrainType.num);
if (it == terrainTypeToString.end()) return os << "<Unknown type>";
else return os << it->second;
}
std::string ETerrainType::toString() const
{
std::stringstream ss;
ss << *this;
return ss.str();
}
std::ostream & operator<<(std::ostream & os, const EPathfindingLayer pathfindingLayer)
{
static const std::map<EPathfindingLayer::EEPathfindingLayer, std::string> pathfinderLayerToString