00001
#include "FrameAnimationManager.h"
00002
00003 CFrameAnimationManager::CFrameAnimationManager()
00004 {
00005
00006 }
00007
00008 CFrameAnimationManager::~CFrameAnimationManager()
00009 {
00010
00011 }
00012
00013
int CFrameAnimationManager::Load(
TiXmlNode *DataNode, string Filename)
00014 {
00015
TiXmlElement* XMLElement = NULL;
00016
const char *Value = NULL;
00017
00018
int Ret = CAnimationManager::Load(DataNode, Filename);
00019
if(Ret !=1)
00020
return Ret;
00021
00022 XMLElement =
m_pXMLElement;
00023
00024
return 1;
00025 }
00026
00027
int CFrameAnimationManager::Save(
TiXmlNode *DataNode, string Filename)
00028 {
00029
00030
return 1;
00031 }
00032
00033
CAnimation *
CFrameAnimationManager::AddResource(
TiXmlNode *DataNode, string Filename, UINT ID, string Name)
00034 {
00035
if(DataNode == NULL)
00036
return NULL;
00037
00038
if
00039
CAnimation *NewFrameAnimation =
new CAnimation;
00040
if(NewFrameAnimation->Load(DataNode, Filename))
00041 {
00042
if(NewFrameAnimation->
GetID() == 0)
00043 NewFrameAnimation->
SetID(ID);
00044
00045
if(NewFrameAnimation->
GetName() ==
"")
00046 NewFrameAnimation->
SetName(Name);
00047
00048 push_back(NewFrameAnimation);
00049
return NewFrameAnimation;
00050 }
00051
00052
return NULL;
00053 }
00054
00055
CAnimation *
CFrameAnimationManager::GetResource(
int Index,
int ID, string Name)
00056 {
00057
if(ID !=-1 && Index == -1 && Name ==
"")
00058 {
00059
CResource *ResourcePtr = begin();
00060 set_ptr(ResourcePtr);
00061
00062
while(ResourcePtr !=NULL)
00063 {
00064
if(ResourcePtr->
GetID() == ID)
00065
return (
CAnimation *)ResourcePtr;
00066
00067 ResourcePtr = next();
00068 }
00069 }
00070
else if(Name !=
"" && Index == -1 && ID == -1)
00071 {
00072
CResource *ResourcePtr = begin();
00073 set_ptr(ResourcePtr);
00074
00075
while(ResourcePtr !=NULL)
00076 {
00077
if(ResourcePtr->
GetName() == Name)
00078
return (
CAnimation *)ResourcePtr;
00079
00080 ResourcePtr = next();
00081 }
00082 }
00083
else if(Index !=-1 && ID == -1 && Name ==
"")
00084 {
00085
if(Index >=0 && Index < size())
00086
return (
CAnimation *)at(Index);
00087 }
00088
00089
return NULL;
00090 }
00091
00092
int CFrameAnimationManager::RemoveResource(
CAnimation *FrameAnimation)
00093 {
00094
00095
return 1;
00096 }
00097
00098
void CFrameAnimationManager::Destroy()
00099 {
00100
CAnimationManager::Destroy();
00101 }