The object specifications
Now, we know that all our game objects will be built from a selection of components. Sometimes, these 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 that the other specifications can derive from. This allows us to 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 that the factory class can get 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...