// // ReboltRunDelegate.hpp // redream_runtime // // Created by zhu on 2022/11/3. // #ifndef ReboltRunDelegate_hpp #define ReboltRunDelegate_hpp #include #include #include typedef enum ReboltErrorType{ ReboltErrorTypeNone, ReboltErrorTypeWarn, ReboltErrorTypeError } ReboltLogType; typedef struct ReboltErrorInfo{ ReboltErrorType errorType; std::string errorDes; ReboltErrorInfo(){ errorType = ReboltErrorTypeNone; errorDes = ""; } } ReboltErrorInfo; /// rebolt运行时的一些回调方法 class ReboltRunDelegate { public: /// 开始播放一棵树 /// - Parameter treeId: 树的随机ID virtual void onTreePlayStart(const std::string treeId) = 0; /// 树播放完毕 /// - Parameter treeId: 树的随机ID /// - Parameter finishType: 结束类型 枚举{BT_INVALID, BT_SUCCESS, BT_FAILURE, BT_RUNNING,} /// - Parameter params: 预留的参数map virtual void onTreePlayFinished(const std::string treeId, int finishType, const std::map params = {}) = 0; /// Block开始播放 /// - Parameter treeId: 树的随机ID /// - Parameter stepId: block块的ID virtual void onTreeStepStart(const std::string treeId, const std::string stepId) = 0; /// 错误信息 /// - Parameters: /// - errorJson: 错位信息{ "treeName", string树的名字}, { "blockId", string block块的ID}, { "errorType", int错误类型 0、无1、警告2、错误}, { "errorDes", string错误信息} virtual void onError(const std::string errorJson) = 0; }; #endif /* ReboltRunDelegate_hpp */