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)
var createNode ( var filename)
local createNode ( local 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)
var setJsonPath ( var jsonPath)
local setJsonPath ( local jsonPath)
std::string getJsonPath () const

Static Public Member Functions

static NodeReadergetInstance ()
local getInstance ()
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)
var loadNode ( var json)
local loadNode ( local json)
void locateNodeWithMulresPosition (cocos2d::Node *node, const rapidjson::Value &json)
var locateNodeWithMulresPosition ( var node, var json)
local locateNodeWithMulresPosition ( local node, local 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
var NodeCreateFunc
protected
local NodeCreateFunc
protected
typedef std::pair<std::string,
NodeCreateFunc> Pair
protected
var Pair
protected
local Pair
protected

Constructor & Destructor Documentation

var NodeReader ( )
local NodeReader ( )

Member Function Documentation

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

Member Data Documentation

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

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