1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- //
- // LoopWaiter.hpp
- // redream_runtime_mac
- //
- // Created by zhu on 2023/5/23.
- //
- #ifndef LoopWaiter_hpp
- #define LoopWaiter_hpp
- #include "WaitableStateBase.hpp"
- #include "behaviac/RedBehaviacTree.h"
- namespace redream {
- class LoopWaiter : public WaitableStateBase, public red::RedBehaviacTreeDelegate {
- public:
- static LoopWaiter* create(ReboltRedManager* reboltManager, red::RedBehaviacTree* tree, std::map<std::string, bool> &boolMap, std::map<std::string, std::string> &stringMap, std::string treeName);
-
- LoopWaiter(ReboltRedManager* reboltManager, red::RedBehaviacTree* tree, std::map<std::string, bool> &boolMap, std::map<std::string, std::string> &stringMap, std::string treeName);
- ~LoopWaiter();
-
- bool init();
-
- int getLoopTimes();
-
- void onLoopEnd();
- public:
- virtual void run() override;
-
- void onTreeRunningEnd(red::RedBehaviacTree* tree, int endType, std::string treeName) override;
-
- private:
- void createTreeAndRun();
- private:
- int _loopTimes;
- std::string _treeName;
- std::map<std::string, bool> _boolMap;
- std::map<std::string, std::string> _stringMap;
- bool _isLoopEnd;
-
- red::RedBehaviacTree* _tree;
- };
- };
- #endif /* LoopWaiter_hpp */
|