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-09-24 11:47:33 +08:00
|
|
|
class CCNodeLoader;
|
|
|
|
|
2012-11-26 21:51:05 +08:00
|
|
|
typedef std::map<std::string, CCNodeLoader *> CCNodeLoaderMap;
|
|
|
|
typedef std::pair<std::string, CCNodeLoader *> CCNodeLoaderMapEntry;
|
2012-06-15 04:51:32 +08:00
|
|
|
|
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);
|
2012-11-26 21:51:05 +08:00
|
|
|
//void registerCCNodeLoader(CCString * pClassName, CCNodeLoader * pCCNodeLoader);
|
2012-06-14 16:16:54 +08:00
|
|
|
void unregisterCCNodeLoader(const char * pClassName);
|
2012-11-26 21:51:05 +08:00
|
|
|
//void unregisterCCNodeLoader(CCString * pClassName);
|
2012-06-14 16:16:54 +08:00
|
|
|
CCNodeLoader * getCCNodeLoader(const char * pClassName);
|
2012-11-26 21:51:05 +08:00
|
|
|
//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
|