]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/TypeDescription.cpp
initialize objects after loading
[l2e.git] / src / loader / TypeDescription.cpp
index c6e5d7e876498bf5a7c0aae6713ce148f956dfaf..bd63d70137b5f0a27c2f6939a6bc14e11d05d692 100644 (file)
@@ -46,6 +46,12 @@ void TypeDescription::Construct(void *data) const {
        }
 }
 
+void TypeDescription::Init(void *data) const {
+       if (initializer) {
+               (*initializer)(data);
+       }
+}
+
 void TypeDescription::Load(void *data) const {
        if (loader) {
                (*loader)(data);
@@ -107,6 +113,20 @@ const TypeDescription &TypeDescription::Get(int id) {
 }
 
 
+int TypeDescription::GetMaxSize() {
+       int max = 0;
+       for (map<int, TypeDescription>::const_iterator
+                       i(typeDescriptions.begin()),
+                       end(typeDescriptions.end());
+                       i != end; ++i) {
+               if (i->second.Size() > max) {
+                       max = i->second.Size();
+               }
+       }
+       return max;
+}
+
+
 void TypeDescription::WriteSourceWiki(std::ostream &out) {
        vector<string> types;
        for (map<int, TypeDescription>::const_iterator i(typeDescriptions.begin()), end(typeDescriptions.end()); i != end; ++i) {