Coding the PlayModeObjectLoader class
This is the class that will pass GameObjectBlueprint
instances to BlueprintObjectParser
. When it gets the completed blueprint back, it will pass them to the GameObjectFactoryPlayMode
class, which will construct the GameObject
instance and pack it away in the vector
instance. Once all the GameObject
instances have been built and stored, responsibility will be handed to the LevelManager
class, which will control access to the vector for other parts of the game engine. This is a very small class with just one function, but it links many other classes together. Refer to the diagram at the start of this chapter for clarification.
Create a new header file in the Header Files/FileIO
filter called PlayModeObjectLoader.h
and add the following code:
#pragma once #include <vector> #include <string> #include "GameObject.h" #include "BlueprintObjectParser.h" #include "GameObjectFactoryPlayMode.h" using namespace...