qaf::GameObjFactory Class Reference

#include <qafGameObjFactory.h>

List of all members.


Detailed Description

The object factory will be queried by the Environment to create the Room's game objects.

Implementations should be registered via the Environment::setGameObjFactory() method.


Public Member Functions

virtual GameObjcreateObject (std::string &objID, int objX, int objY, AttributeTable &attributes)=0
 Creates a GameObj instance based on its parameters.


Member Function Documentation

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.

Parameters:
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.
Returns:
A new game object to be inserted into the Environment, or NULL if the object could not be created.


The documentation for this class was generated from the following file:
Generated on Sun Mar 25 12:32:14 2007 for Qaf Framework by  doxygen 1.5.1-p1