cocos2d-x  3.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
NodeReader Class Reference

#include <CCNodeReader.h>

Public Member Functions

 NodeReader ()
 
void purge ()
 
void init ()
 
cocos2d::NodecreateNode (const std::string &filename)
 
cocos2d::NodeloadNodeWithFile (const std::string &fileName)
 
cocos2d::NodeloadNodeWithContent (const std::string &content)
 
void setRecordJsonPath (bool record)
 
bool isRecordJsonPath () const
 
void setJsonPath (std::string jsonPath)
 
std::string getJsonPath () const
 

Static Public Member Functions

static NodeReadergetInstance ()
 
static void destroyInstance ()
 

Protected Types

typedef std::function
< cocos2d::Node *(const
rapidjson::Value &json)> 
NodeCreateFunc
 
typedef std::pair< std::string,
NodeCreateFunc
Pair
 

Protected Member Functions

cocos2d::NodeloadNode (const rapidjson::Value &json)
 
void locateNodeWithMulresPosition (cocos2d::Node *node, const rapidjson::Value &json)
 
void initNode (cocos2d::Node *node, const rapidjson::Value &json)
 
cocos2d::NodeloadSimpleNode (const rapidjson::Value &json)
 
cocos2d::NodeloadSubGraph (const rapidjson::Value &json)
 
cocos2d::NodeloadSprite (const rapidjson::Value &json)
 
cocos2d::NodeloadParticle (const rapidjson::Value &json)
 
cocos2d::NodeloadWidget (const rapidjson::Value &json)
 

Protected Attributes

std::unordered_map
< std::string, NodeCreateFunc
_funcs
 
bool _recordJsonPath
 
std::string _jsonPath
 

Member Typedef Documentation

typedef std::function<cocos2d::Node*(const rapidjson::Value& json)> NodeCreateFunc
protected
typedef std::pair<std::string, NodeCreateFunc> Pair
protected

Constructor & Destructor Documentation

Member Function Documentation

cocos2d::Node* createNode ( const std::string &  filename)
static void destroyInstance ( )
static
static NodeReader* getInstance ( )
static
std::string getJsonPath ( ) const
inline
void init ( )
void initNode ( cocos2d::Node node,
const rapidjson::Value &  json 
)
protected
bool isRecordJsonPath ( ) const
inline
cocos2d::Node* loadNode ( const rapidjson::Value &  json)
protected
cocos2d::Node* loadNodeWithContent ( const std::string &  content)
cocos2d::Node* loadNodeWithFile ( const std::string &  fileName)
cocos2d::Node* loadParticle ( const rapidjson::Value &  json)
protected
cocos2d::Node* loadSimpleNode ( const rapidjson::Value &  json)
protected
cocos2d::Node* loadSprite ( const rapidjson::Value &  json)
protected
cocos2d::Node* loadSubGraph ( const rapidjson::Value &  json)
protected
cocos2d::Node* loadWidget ( const rapidjson::Value &  json)
protected
void locateNodeWithMulresPosition ( cocos2d::Node node,
const rapidjson::Value &  json 
)
protected
void purge ( )
void setJsonPath ( std::string  jsonPath)
inline
void setRecordJsonPath ( bool  record)
inline

Member Data Documentation

std::unordered_map<std::string, NodeCreateFunc> _funcs
protected
std::string _jsonPath
protected
bool _recordJsonPath
protected

The documentation for this class was generated from the following file: