Our game objects are mostly just collections of components. Each object type will have different components and component data based on the decisions of the designer. As the development progresses, those collections are likely to change. Remember, even though each individual component has a builder in the factory, the object will need to somehow instantiate the separate components. Let's look at shortened examples of using builders for the Player and Raider objects:
//PlayerBuilder.h-------------------- #include "M5ObjectBuilder.h" class PlayerBuilder: public M5ObjectBuilder { public: virtual M5Object* Build(void); }; //PlayerBuilder.cpp-------------------- #include "PlayerBuilder.h" #include "M5Object.h"