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

Use const for ObjectTemplate

This commit is contained in:
AlexVinS
2016-09-08 18:06:28 +03:00
parent 114dac7e81
commit a109580b91
7 changed files with 32 additions and 32 deletions

View File

@ -433,11 +433,11 @@ boost::optional<std::string> AObjectTypeHandler::getCustomName() const
return objectName;
}
void AObjectTypeHandler::addTemplate(ObjectTemplate templ)
void AObjectTypeHandler::addTemplate(const ObjectTemplate & templ)
{
templ.id = Obj(type);
templ.subid = subtype;
templates.push_back(templ);
templates.back().id = Obj(type);
templates.back().subid = subtype;
}
void AObjectTypeHandler::addTemplate(JsonNode config)
@ -449,7 +449,7 @@ void AObjectTypeHandler::addTemplate(JsonNode config)
tmpl.subid = subtype;
tmpl.stringID = ""; // TODO?
tmpl.readJson(config);
addTemplate(tmpl);
templates.push_back(tmpl);
}
std::vector<ObjectTemplate> AObjectTypeHandler::getTemplates() const