Instead of defining a parse static member function for each entity, there should instead be a uniform
namespace phoenix {
template <typename T>
T parse(buffer&);
template <typename T>
T parse(buffer&&);
template <typename T>
T parse(archive_reader&);
}
This can only be implemented if a heuristic for detecting the Gothic version within worlds can be found. One idea would be to search through the archive's key-map to find object keys only present in Gothic 2 VObs, like visualAniMode (probably unlikely to yield good results since it's in the base zCVob which is most likely packed), canMove or fadeOutSky. It might still be a good idea, however, to keep the explicit version around somehow, so consumers of the library can prevent loading the wrong version anyways.
This alteration should also apply to dumping function (if implemented):
Instead of defining a
parse
static member function for each entity, there should instead be a uniformThis can only be implemented if a heuristic for detecting the Gothic version within worlds can be found. One idea would be to search through the archive's key-map to find object keys only present in Gothic 2 VObs, like
visualAniMode
(probably unlikely to yield good results since it's in the basezCVob
which is most likely packed),canMove
orfadeOutSky
. It might still be a good idea, however, to keep the explicit version around somehow, so consumers of the library can prevent loading the wrong version anyways.This alteration should also apply to dumping function (if implemented):