00001
00002
00003
00004
00005 #include "../tinyxml.h"
00006 #include "../Log.h"
00007 #include "IResource.h"
00008 #include "FontResource.h"
00009 #include "FontFactory.h"
00010
00011 using namespace std;
00012
00013 FontFactory::~FontFactory() {
00014 Log::s_log->Message("Font factory deleted");
00015 }
00016
00017 IResource* FontFactory::NewResource(TiXmlElement *XmlElement) {
00018 string name, filename, characters;
00019
00020 if (string(XmlElement->Attribute("type")) != FontResource::s_type) {
00021 throw string("Invalid resource type");
00022 }
00023
00024 name = string(XmlElement->Attribute("name"));
00025 filename = string(XmlElement->Attribute("filename"));
00026 characters = string(XmlElement->Attribute("characters"));
00027
00028 return new FontResource(name, filename, characters);
00029 }