animtable.h
Go to the documentation of this file.00001 #ifndef GRAPHICS_ANIMTABLE_H
00002 #define GRAPHICS_ANIMTABLE_H
00003
00011 #include "foundation/refcounted.h"
00012 #include "xml/nxmlspreadsheet.h"
00013
00014
00015 namespace Graphics
00016 {
00017 class AnimTable : public Foundation::RefCounted
00018 {
00019 DeclareRtti;
00020 DeclareFactory(AnimTable);
00021
00022 public:
00024 AnimTable();
00026 virtual ~AnimTable();
00028 static AnimTable* Instance();
00030 void SetFilename(const nString& n);
00032 const nString& GetFilename() const;
00034 bool Open();
00036 void Close();
00038 bool IsOpen() const;
00040 const nString& Lookup(const nString& column, const nString& animName) const;
00041
00042 private:
00043 static AnimTable* Singleton;
00044 nXmlSpreadSheet xmlSpreadsheet;
00045 };
00046
00047 RegisterFactory(AnimTable);
00048
00049
00052 inline
00053 AnimTable*
00054 AnimTable::Instance()
00055 {
00056 n_assert(Singleton);
00057 return Singleton;
00058 }
00059
00060
00063 inline
00064 bool
00065 AnimTable::IsOpen() const
00066 {
00067 return this->xmlSpreadsheet.IsOpen();
00068 }
00069
00070
00073 inline
00074 void
00075 AnimTable::SetFilename(const nString& n)
00076 {
00077 this->xmlSpreadsheet.SetFilename(n);
00078 }
00079
00080
00083 inline
00084 const nString&
00085 AnimTable::GetFilename() const
00086 {
00087 return this->xmlSpreadsheet.GetFilename();
00088 }
00089
00090 };
00091
00092 #endif