#include <qafGameObjFactory.h>
Environment to create the Room's game objects.
Implementations should be registered via the Environment::setGameObjFactory() method.
Public Member Functions | |
| virtual GameObj * | createObject (std::string &objID, int objX, int objY, AttributeTable &attributes)=0 |
Creates a GameObj instance based on its parameters. | |
| virtual GameObj* qaf::GameObjFactory::createObject | ( | std::string & | objID, | |
| int | objX, | |||
| int | objY, | |||
| AttributeTable & | attributes | |||
| ) | [pure virtual] |
Creates a GameObj instance based on its parameters.
When a room is loaded, the Environment will read the game objects stored in it and forward their data to the registered factory.
The object returned by this method will be inserted into the room's default object layer and its initialize() method will be called.
The object's attribute table is transformed into a map (from the C++ STL), where keys and values are both strings.
| objID | The object ID defined in the Room Editor. | |
| objX | The X position the object was placed at in the Room Editor. | |
| objY | The Y position the object was placed at in the Room Editor. | |
| attributes | The attributes defined for this object in the Room Editor. |
Environment, or NULL if the object could not be created.
1.5.1-p1