|
这个是flipCode上的,我脸皮厚给大家转过来,呵呵:
Some time ago I started to wonder about the flexible capabilities of XML, but at the moment few game developers use it.
Talking about this matter with some others game developers I saw that some of them are expecting to use it in their new projects.
I wrote the class CClassFactory, that it's just a simple implementation of "something like a" class factory, using XML.
It wasn't made to be really useful, but just to show how flexible and easy it could be to make complex data relationships with xml, which makes it a great point for game developers because sometimes we really get mixed up with scripting, data, and so one.
This code could be extended further, with more features and perhaps with some scripting system that allows (in a easy way) to modify the context of the class factory, and so one.
In the source code you'll find :
The class factory itself
ClassFactory.h
ClassFactory.cpp
A visual Studio 6 MFC Project that uses those classes to show the funcionality of the system.
A directory called \doc with the documentation of the class in html and rtf format , thanks to Doxygen, a really great code doc tool.
Note : CClassFactory uses tinyxml a great XML parser included in the project
Juan Antonio Medina ^ mICrO
|
|