I have a system where I have a class called BObj which is inherited by multiple other classes. These classes are different in how they behave, but they both use the same hgeSprite object across all instances of the classes. With my derived classes being CPlayer and CTile, all instances of CPlayer use the same hgeSprite object and all instances of CTile use the same hgeSprite object. This behavior will be the same for all classes that are derived from the BObj class, and so I would like to make this easy to implement simply by creating a supposedly virtual static member of the BObj class to be inherited by the derived classes. However, I don't really think this is possible.
My idea for a work-around is to instantiate an object of each derived class and set the hgeSprite object in those first objects and simply have every object after that have a pointer to the hgeSprite object in the first object. But this is messy, and I'd really rather not have to do that.
Does anyone have any ideas on how I could get this done without really getting my hands dirty?