diff --git a/include/Type.h b/include/Type.h index 0db9db5c5303689c2ce2d3225c4d57245cf5e49f..8c41a6f2092c40a46c51a860e258a82f4e3c24c9 100644 --- a/include/Type.h +++ b/include/Type.h @@ -28,8 +28,10 @@ public: NIFLIB_API bool operator<( const Type & compare_to ) const; NIFLIB_API NiObject * Create() const; const Type * base_type; + const int internal_type_number; private: string name; + static int num_types; }; } diff --git a/src/Type.cpp b/src/Type.cpp index 1a4a41e035a4f3ce3ba25eec6e29f78eb4329cd5..09639ef7baa091a188c8709780c83e0b881c2c8f 100644 --- a/src/Type.cpp +++ b/src/Type.cpp @@ -5,7 +5,9 @@ All rights reserved. Please see niflib.h for license. */ #include "../include/ObjectRegistry.h" using namespace Niflib; -Type::Type (const string & type_name, const Type * par_type ) : name(type_name), base_type(par_type) {} +int Type::num_types = 0; + +Type::Type (const string & type_name, const Type * par_type ) : name(type_name), base_type(par_type), internal_type_number(num_types++) {} Type::~Type() {}