src/ResourceManager/SoundFactory.cpp

Go to the documentation of this file.
00001 /* Crown and Cutlass
00002  * SoundFactory Code
00003  */
00004 
00005 #include "../tinyxml.h"
00006 #include "../Log.h"
00007 #include "IResource.h"
00008 #include "SoundResource.h"
00009 #include "SoundFactory.h"
00010 
00011 using namespace std;
00012 
00013 SoundFactory::~SoundFactory() {
00014   Log::s_log->Message("Sound factory deleted");
00015 }
00016 
00017 IResource* SoundFactory::NewResource(TiXmlElement *XmlElement) {
00018   string name, filename;
00019 
00020   if (string(XmlElement->Attribute("type")) != SoundResource::s_type) {
00021     throw string("Invalid resource type");
00022   }
00023 
00024   name = string(XmlElement->Attribute("name"));
00025   filename = string(XmlElement->Attribute("filename"));
00026 
00027   return new SoundResource(name, filename);
00028 }

Generated on Mon Jan 8 22:34:12 2007 for CrownandCutlass by  doxygen 1.4.7