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
|
|
|
|
|
2013-06-20 14:15:53 +08:00
|
|
|
class NodeLoader;
|
2012-09-24 11:47:33 +08:00
|
|
|
|
2013-06-20 14:15:53 +08:00
|
|
|
typedef std::map<std::string, NodeLoader *> NodeLoaderMap;
|
|
|
|
typedef std::pair<std::string, NodeLoader *> NodeLoaderMapEntry;
|
2012-06-15 04:51:32 +08:00
|
|
|
|
2013-06-20 14:15:53 +08:00
|
|
|
class NodeLoaderLibrary : public Object {
|
2012-06-06 08:15:28 +08:00
|
|
|
private:
|
2013-06-20 14:15:53 +08:00
|
|
|
NodeLoaderMap mNodeLoaders;
|
2012-06-06 08:15:28 +08:00
|
|
|
|
|
|
|
public:
|
2013-06-20 14:15:53 +08:00
|
|
|
CCB_STATIC_NEW_AUTORELEASE_OBJECT_METHOD(NodeLoaderLibrary, library);
|
|
|
|
|
|
|
|
NodeLoaderLibrary();
|
|
|
|
virtual ~NodeLoaderLibrary();
|
|
|
|
|
|
|
|
void registerDefaultNodeLoaders();
|
|
|
|
void registerNodeLoader(const char * pClassName, NodeLoader * pNodeLoader);
|
|
|
|
//void registerNodeLoader(String * pClassName, NodeLoader * pNodeLoader);
|
|
|
|
void unregisterNodeLoader(const char * pClassName);
|
|
|
|
//void unregisterNodeLoader(String * pClassName);
|
|
|
|
NodeLoader * getNodeLoader(const char * pClassName);
|
|
|
|
//CCNodeLoader * getNodeLoader(String * pClassName);
|
2012-06-06 08:15:28 +08:00
|
|
|
void purge(bool pDelete);
|
|
|
|
|
|
|
|
public:
|
2013-06-20 14:15:53 +08:00
|
|
|
static NodeLoaderLibrary * sharedNodeLoaderLibrary();
|
|
|
|
static void purgeSharedNodeLoaderLibrary();
|
2012-06-12 01:43:07 +08:00
|
|
|
|
2013-06-20 14:15:53 +08:00
|
|
|
static NodeLoaderLibrary * newDefaultNodeLoaderLibrary();
|
2012-06-06 08:15:28 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
NS_CC_EXT_END
|
|
|
|
|
|
|
|
#endif
|