ToySimpleActionParser.h 2.75 KB
//
//  ToySimpleActionParser.h
//  SteveMaggieCpp
//
//  Created by Katarzyna Kalinowska-Górska on 31.05.2017.
//
//

#ifndef ToySimpleActionParser_h
#define ToySimpleActionParser_h

#include "ToyActionParser.h"

class ToySimpleActionParser
{
     public:

        static ToySimpleActionParser& getInstance()
        {
            static ToySimpleActionParser instance;
            return instance;
        };

        cocos2d::Action* parseJSONAction(const rapidjson::Value& jsonActionObject, ActionParseDelegate* parseDelegate, bool notifyDelegateWhenFinished = true);
    
    protected:
        cocos2d::Action* parseWaitAction(const rapidjson::Value& jsonActionObject, ActionParseDelegate* parseDelegate, bool notifyDelegateWhenFinished);
        cocos2d::Action* parseCreateObjectAction(const rapidjson::Value& jsonActionObject, ActionParseDelegate* parseDelegate, bool notifyDelegateWhenFinished);
        cocos2d::Action* parseSetPropertyAction(const rapidjson::Value& jsonActionObject, ActionParseDelegate* parseDelegate, bool notifyDelegateWhenFinished);
        cocos2d::Action* parseCallFunctionAction(const rapidjson::Value& jsonActionObject, ActionParseDelegate* parseDelegate, bool notifyDelegateWhenFinished);
        cocos2d::Action* parsePlaySoundAction(const rapidjson::Value& jsonActionObject, ActionParseDelegate* parseDelegate, bool notifyDelegateWhenFinished);
        cocos2d::Action* parsePlayRandomSoundAction(const rapidjson::Value& jsonActionObject, ActionParseDelegate* parseDelegate, bool notifyDelegateWhenFinished);
        cocos2d::Action* parseReorderInParentAction(const rapidjson::Value& jsonActionObject, ActionParseDelegate* parseDelegate, bool notifyDelegateWhenFinished);
        cocos2d::Action* parseAnimateObjectsAction(const rapidjson::Value& jsonActionObject, ActionParseDelegate* parseDelegate, bool notifyDelegateWhenFinished);
        cocos2d::Action* parseAnimateObjectByAnimationIdAction(const rapidjson::Value& jsonActionObject, ActionParseDelegate* parseDelegate, bool notifyDelegateWhenFinished);
        cocos2d::Action* parseStopAnimationsAction(const rapidjson::Value& jsonActionObject, ActionParseDelegate* parseDelegate, bool notifyDelegateWhenFinished);
        cocos2d::Action* parseDismissCurrentDialogAction(const rapidjson::Value& jsonActionObject, ActionParseDelegate* parseDelegate, bool notifyDelegateWhenFinished);
        cocos2d::Action* parseRandomObjectSwapAction(const rapidjson::Value& jsonActionObject, ActionParseDelegate* parseDelegate, bool notifyDelegateWhenFinished);
        cocos2d::Action* finalizeParseActionWithActionFunction(const rapidjson::Value& jsonActionObject, ActionParseDelegate* parseDelegate, bool notifyDelegateWhenFinished, std::function<void()> preparedActionFunction);
};

#endif /* ToySimpleActionParser_h */