Is there a way to check what the type_info of a superclass is? In my system objects are identified by a set of bits. Which is Identified by the type_info hashcode. I would like some of these types to enable polymorphism in a sense that my system thinks they are under the same bit. type_info creates a unique hashcode for every class type. Instead I want the derived classes to take the bit set of their superclass like so:
Component > ISomeInterfaceComponent -> bit = 00001
|
\ ComponentContextA -> bit = ISomeInterFaceComponent bit
|
\ ComponentContextB -> bit = ISomeInterFaceComponent bit
|
\ ComponentContextC -> bit = ISomeInterFaceComponent bit
This should add the object containing the components to one system for processing.
As of right now this is what happens:
Component > ISomeInterFaceComponent -> bit = 00001
|
\ ComponentContextA -> bit = 00010
|
\ ComponentContextB -> bit = 00100
|
\ ComponentContextC -> bit = 01000
Which demands that I create different systems for all components.
If anyone could give me pointers on how I could achieve this that would be great.
Edit: To prevent confusion to get a bit set for a type it goes as follows: ComponentTypeManager::getBit();
So I'm not working with instances. And I would love to keep the current system in lock.