Game Development Community

NetEvents and multiple inheritance

by Ingo Seidel · in Torque Game Engine · 08/07/2008 (3:42 am) · 3 replies

Hi,

is it possible to use multiple inheritance when implementing a custom NetEvent? It looks as follows:

class CustomEvent : public CustomSuperClass, public NetEvent
{
   ...
};

When using this kind of construct, an assertion in the ConsoleObject::getClassId is violated: "Cannot get tag from non-declared dynamic class!". I am not sure whether this is caused by the multiple inheritance, or not, but I could not find any other issue that might cause the problem.

thanks

hubsi

#1
08/07/2008 (12:31 pm)
I would think you could do multiple inheritance. Does your CustomSuperClass have a cpp (just asking since it says its non-declared)? Is it a Templated class? Also make sure you typedef Parent to NetEvent and not your other class.
#2
08/07/2008 (11:33 pm)
What do you mean by "cpp"? If you mean the console declaration macros, yes they are defined. Typedef is also there and it is not a templated class. What exactly does the error "Cannot get tag from non-declared dynamic class!" mean?
#3
08/08/2008 (12:10 am)
I haven't run across that one before... Why not derive your "super" class from NetEvent, then use single inheritance to derive from that?