The object specifications
Now we know that all our game objects will be built from a selection of components. Sometimes the components will be unique to a specific game object but most of the time the components will be used in multiple different game objects. We need a way to specify a game object so that the factory class knows what components to use to construct each one.
First, we need a parent specification class from which all the other specifications can derive so we can use them all polymorphically and not have to build a different factory or different methods within the same factory for each type of object.
Coding the ObjectSpec parent class
This class will be the base/parent class for all the specification classes. It will have all the required getters so the factory class can get at all the data it needs. Then, as we will see shortly, all the classes that represent real game objects will simply have to initialize the appropriate member variables and call the parent class's...