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

#include <CCActionTimelineCache.h>

Public Member Functions

void purge ()
void init ()
void removeAction (const std::string &fileName)
 Remove action with filename, and also remove other resource relate with this file. More...
 
ActionTimeline * createActionFromJson (const std::string &fileName)
 Clone a action with the specified name from the container. More...
 
ActionTimeline * loadAnimationActionWithFile (const std::string &fileName)
ActionTimeline * loadAnimationActionWithContent (const std::string &fileName, const std::string &content)
ActionTimeline * createActionWithFlatBuffersFile (const std::string &fileName)
ActionTimeline * loadAnimationActionWithFlatBuffersFile (const std::string &fileName)
ActionTimeline * createActionWithFlatBuffersForSimulator (const std::string &fileName)

Static Public Member Functions

static ActionTimelineCache * getInstance ()
 Gets the singleton. More...
 
static void destroyInstance ()
 Destroys the singleton. More...
 
static ActionTimeline * createAction (const std::string &fileName)

Protected Types

typedef std::function< Frame
*(const rapidjson::Value &json)> 
FrameCreateFunc
typedef std::pair< std::string,
FrameCreateFunc > 
Pair

Protected Member Functions

Timeline * loadTimeline (const rapidjson::Value &json)
Frame * loadVisibleFrame (const rapidjson::Value &json)
Frame * loadPositionFrame (const rapidjson::Value &json)
Frame * loadScaleFrame (const rapidjson::Value &json)
Frame * loadSkewFrame (const rapidjson::Value &json)
Frame * loadRotationSkewFrame (const rapidjson::Value &json)
Frame * loadRotationFrame (const rapidjson::Value &json)
Frame * loadAnchorPointFrame (const rapidjson::Value &json)
Frame * loadInnerActionFrame (const rapidjson::Value &json)
Frame * loadColorFrame (const rapidjson::Value &json)
Frame * loadTextureFrame (const rapidjson::Value &json)
Frame * loadEventFrame (const rapidjson::Value &json)
Frame * loadZOrderFrame (const rapidjson::Value &json)
Timeline * loadTimelineWithFlatBuffers (const flatbuffers::TimeLine *flatbuffers)
Frame * loadVisibleFrameWithFlatBuffers (const flatbuffers::BoolFrame *flatbuffers)
Frame * loadPositionFrameWithFlatBuffers (const flatbuffers::PointFrame *flatbuffers)
Frame * loadScaleFrameWithFlatBuffers (const flatbuffers::ScaleFrame *flatbuffers)
Frame * loadRotationSkewFrameWithFlatBuffers (const flatbuffers::ScaleFrame *flatbuffers)
Frame * loadColorFrameWithFlatBuffers (const flatbuffers::ColorFrame *flatbuffers)
Frame * loadTextureFrameWithFlatBuffers (const flatbuffers::TextureFrame *flatbuffers)
Frame * loadEventFrameWithFlatBuffers (const flatbuffers::EventFrame *flatbuffers)
Frame * loadAlphaFrameWithFlatBuffers (const flatbuffers::IntFrame *flatbuffers)
Frame * loadAnchorPointFrameWithFlatBuffers (const flatbuffers::ScaleFrame *flatbuffers)
Frame * loadZOrderFrameWithFlatBuffers (const flatbuffers::IntFrame *flatbuffers)
Frame * loadInnerActionFrameWithFlatBuffers (const flatbuffers::InnerActionFrame *flatbuffers)

Protected Attributes

std::unordered_map
< std::string, FrameCreateFunc > 
_funcs
cocos2d::Map< std::string,
ActionTimeline * > 
_animationActions

Member Typedef Documentation

typedef std::function<Frame*(const
rapidjson::Value& json)>
FrameCreateFunc
protected
typedef std::pair<std::string,
FrameCreateFunc> Pair
protected

Member Function Documentation

static ActionTimeline* createAction ( const std::string &  fileName)
static
ActionTimeline*
createActionFromJson
( const std::string &  fileName)

Clone a action with the specified name from the container.

ActionTimeline*
createActionWithFlatBuffersFile
( const std::string &  fileName)
ActionTimeline*
createActionWithFlatBuffersForSimulator
( const std::string &  fileName)
static void destroyInstance ( )
static

Destroys the singleton.

static ActionTimelineCache*
getInstance
( )
static

Gets the singleton.

void init ( )
Frame*
loadAlphaFrameWithFlatBuffers
( const flatbuffers::IntFrame *  flatbuffers)
protected
Frame* loadAnchorPointFrame ( const rapidjson::Value &  json)
protected
Frame*
loadAnchorPointFrameWithFlatBuffers
( const flatbuffers::ScaleFrame *  flatbuffers)
protected
ActionTimeline*
loadAnimationActionWithContent
( const std::string &  fileName,
const std::string &  content 
)
ActionTimeline*
loadAnimationActionWithFile
( const std::string &  fileName)
ActionTimeline*
loadAnimationActionWithFlatBuffersFile
( const std::string &  fileName)
Frame* loadColorFrame ( const rapidjson::Value &  json)
protected
Frame*
loadColorFrameWithFlatBuffers
( const flatbuffers::ColorFrame *  flatbuffers)
protected
Frame* loadEventFrame ( const rapidjson::Value &  json)
protected
Frame*
loadEventFrameWithFlatBuffers
( const flatbuffers::EventFrame *  flatbuffers)
protected
Frame* loadInnerActionFrame ( const rapidjson::Value &  json)
protected
Frame*
loadInnerActionFrameWithFlatBuffers
( const flatbuffers::InnerActionFrame *  flatbuffers)
protected
Frame* loadPositionFrame ( const rapidjson::Value &  json)
protected
Frame*
loadPositionFrameWithFlatBuffers
( const flatbuffers::PointFrame *  flatbuffers)
protected
Frame* loadRotationFrame ( const rapidjson::Value &  json)
protected
Frame* loadRotationSkewFrame ( const rapidjson::Value &  json)
protected
Frame*
loadRotationSkewFrameWithFlatBuffers
( const flatbuffers::ScaleFrame *  flatbuffers)
protected
Frame* loadScaleFrame ( const rapidjson::Value &  json)
protected
Frame*
loadScaleFrameWithFlatBuffers
( const flatbuffers::ScaleFrame *  flatbuffers)
protected
Frame* loadSkewFrame ( const rapidjson::Value &  json)
protected
Frame* loadTextureFrame ( const rapidjson::Value &  json)
protected
Frame*
loadTextureFrameWithFlatBuffers
( const flatbuffers::TextureFrame *  flatbuffers)
protected
Timeline* loadTimeline ( const rapidjson::Value &  json)
protected
Timeline*
loadTimelineWithFlatBuffers
( const flatbuffers::TimeLine *  flatbuffers)
protected
Frame* loadVisibleFrame ( const rapidjson::Value &  json)
protected
Frame*
loadVisibleFrameWithFlatBuffers
( const flatbuffers::BoolFrame *  flatbuffers)
protected
Frame* loadZOrderFrame ( const rapidjson::Value &  json)
protected
Frame*
loadZOrderFrameWithFlatBuffers
( const flatbuffers::IntFrame *  flatbuffers)
protected
void purge ( )
void removeAction ( const std::string &  fileName)

Remove action with filename, and also remove other resource relate with this file.

Member Data Documentation

cocos2d::Map<std::string,
ActionTimeline*>
_animationActions
protected
std::unordered_map<std::string,
FrameCreateFunc> _funcs
protected

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