ToyWorksheetScene.h 1.54 KB
//
//  ToyWorksheetScene.h
//  SteveMaggieCpp
//
//  Created by Katarzyna Kalinowska-Górska on 18.05.2017.
//
//

#ifndef ToyWorksheetScene_h
#define ToyWorksheetScene_h

#include "ToyParentScene.h"


class ToyWorksheetScene : public ToyParentScene
{
    public:
    
        static ToyWorksheetScene* create(std::string layoutFilePath = "", std::string scenarioFilePath = "");
        bool initWithConfigurationFiles(std::string layoutFilePath,
                                                    std::string scenarioFilePath) override;

        virtual void onEnter() override;
        virtual void onEnterTransitionDidFinish() override;

#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
        void setAndroidBackButtonDisabled(bool disabled){androidBackButtonDisabled = disabled;};
#endif

        //ToyScenarioObject
//        virtual void setProperty(std::string propertyName, const rapidjson::Value& newValue, ActionParseDelegate* parseDelegate) override;
        virtual void callFunctionByName(std::string methodName, const rapidjson::Value* arguments, ActionParseDelegate* parseDelegate, std::function<void()> callback = [](){}) override;
    
    protected:

#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
        bool androidBackButtonDisabled;
#endif

        virtual bool touchHandlerForWidget(std::string objectName, cocos2d::ui::Widget::TouchEventType touchEventType) override;
        virtual bool onBackButtonClicked();
        virtual bool onReplayButtonClicked();
        virtual bool onFastForwardButtonClicked();
};

#endif /* ToyWorksheetScene_h */