1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-19 00:17:56 +02:00

allow configurable battleground graphics

This commit is contained in:
Andrii Danylchenko
2022-06-26 10:21:05 +03:00
parent c4035134e5
commit 3b1d271ae0
12 changed files with 132 additions and 75 deletions

View File

@ -97,6 +97,7 @@ CObjectClassesHandler::CObjectClassesHandler()
SET_HANDLER("oncePerHero", CGVisitableOPH);
SET_HANDLER("oncePerWeek", CGVisitableOPW);
SET_HANDLER("witch", CGWitchHut);
SET_HANDLER("terrain", CGTerrainPatch);
#undef SET_HANDLER_CLASS
#undef SET_HANDLER
@ -514,6 +515,11 @@ void AObjectTypeHandler::init(const JsonNode & input, boost::optional<std::strin
else
aiValue = static_cast<boost::optional<si32>>(input["aiValue"].Integer());
if(input["battleground"].isNull())
battlefield = BattleField::NONE;
else
battlefield = BattleField(input["battleground"].String());
initTypeData(input);
}
@ -569,6 +575,11 @@ std::vector<ObjectTemplate> AObjectTypeHandler::getTemplates() const
return templates;
}
BattleField AObjectTypeHandler::getBattlefield() const
{
return battlefield;
}
std::vector<ObjectTemplate> AObjectTypeHandler::getTemplates(const Terrain & terrainType) const
{
std::vector<ObjectTemplate> templates = getTemplates();