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

Finalization of object type handler interface

- updated code to use new interface
- removed old DefObjHandler (todo - rename file)

Summary:
- most code but loading is now in place
- type names may deserve improvements (some of them are too similar)
- still barely compiles and not tested
This commit is contained in:
Ivan Savenko
2014-05-16 23:50:02 +03:00
parent d805376ab8
commit b5160acbac
16 changed files with 184 additions and 195 deletions

View File

@@ -229,7 +229,7 @@ void CHeroClassHandler::afterLoadFinalization()
}
}
ObjectTemplate base = VLC->dobjinfo->pickCandidates(Obj::HERO, 0).front();
ObjectTemplate base = VLC->objtypeh->getHandlerFor(Obj::HERO, 0)->getTemplates().front();
for (CHeroClass * hc : heroClasses)
{
base.animationFile = hc->imageMapMale;
@@ -237,8 +237,7 @@ void CHeroClassHandler::afterLoadFinalization()
// replace existing (if any) and add new template.
// Necessary for objects added via mods that don't have any templates in H3
VLC->dobjinfo->eraseAll(Obj::HERO, hc->id);
VLC->dobjinfo->registerTemplate(base);
VLC->objtypeh->getHandlerFor(Obj::HERO, base.subid)->addTemplate(base);
}
}