Is it possible to force a static data member in inherited subclasses?
Here is my problem/thought process:
I want to make a “GameObject’ base class that all other objects inherit from to lend to polymorphism.
I want each inherited class to have a static data member list of vertexes to render the polygons. The exact process would be:
- Create object based on static list of vertexes
- Apply textures
- Rotate object based on instanced object’s rotation variables
- Transform object based on instanced object’s world coordinates
for all objects that inherit from Game Object, I’d like to guarantee that it has the static vertex list
Should I care if it has the list or not, or should I just care that it has a draw method (guaranteed by an interface iRender)?
If the GameObject is an interface, then you can enforce the existence of a
static Property.Alternatively, you could just have the list of vertices as a protected data member in
GameObjectitself, and have the derived classes access it.