2012-06-13 02:59:49 +08:00
|
|
|
#ifndef _CCB_CCNODELOADERLIBRARY_H_
|
|
|
|
#define _CCB_CCNODELOADERLIBRARY_H_
|
2012-06-06 08:15:28 +08:00
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
#include "CCBReader.h"
|
|
|
|
|
|
|
|
NS_CC_EXT_BEGIN
|
|
|
|
|
2012-06-15 04:51:32 +08:00
|
|
|
typedef std::map<CCString *, CCNodeLoader *, CCStringCompare> CCNodeLoaderMap;
|
|
|
|
typedef std::pair<CCString *, CCNodeLoader *> CCNodeLoaderMapEntry;
|
|
|
|
|
2012-07-20 14:05:52 +08:00
|
|
|
class CCNodeLoaderLibrary : public CCObject {
|
2012-06-06 08:15:28 +08:00
|
|
|
private:
|
2012-06-15 04:51:32 +08:00
|
|
|
CCNodeLoaderMap mCCNodeLoaders;
|
2012-06-06 08:15:28 +08:00
|
|
|
|
|
|
|
public:
|
2012-06-15 05:23:53 +08:00
|
|
|
CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(CCNodeLoaderLibrary, library);
|
2012-06-06 08:15:28 +08:00
|
|
|
|
|
|
|
CCNodeLoaderLibrary();
|
2012-06-19 03:03:06 +08:00
|
|
|
virtual ~CCNodeLoaderLibrary();
|
2012-06-06 08:15:28 +08:00
|
|
|
|
|
|
|
void registerDefaultCCNodeLoaders();
|
2012-06-14 16:16:54 +08:00
|
|
|
void registerCCNodeLoader(const char * pClassName, CCNodeLoader * pCCNodeLoader);
|
|
|
|
void registerCCNodeLoader(CCString * pClassName, CCNodeLoader * pCCNodeLoader);
|
|
|
|
void unregisterCCNodeLoader(const char * pClassName);
|
|
|
|
void unregisterCCNodeLoader(CCString * pClassName);
|
|
|
|
CCNodeLoader * getCCNodeLoader(const char * pClassName);
|
|
|
|
CCNodeLoader * getCCNodeLoader(CCString * pClassName);
|
2012-06-06 08:15:28 +08:00
|
|
|
void purge(bool pDelete);
|
|
|
|
|
|
|
|
public:
|
|
|
|
static CCNodeLoaderLibrary * sharedCCNodeLoaderLibrary();
|
2012-06-12 01:43:07 +08:00
|
|
|
static void purgeSharedCCNodeLoaderLibrary();
|
|
|
|
|
2012-06-06 08:15:28 +08:00
|
|
|
static CCNodeLoaderLibrary * newDefaultCCNodeLoaderLibrary();
|
|
|
|
};
|
|
|
|
|
|
|
|
NS_CC_EXT_END
|
|
|
|
|
|
|
|
#endif
|