12345678910111213141516171819202122232425262728293031323334353637 |
- //
- // WaitableStateBase.cpp
- // redream_runtime
- //
- // Created by zhu on 2023/5/24.
- //
- #include "WaitableStateBase.hpp"
- #include "behaviac/RedBehaviacTree.h"
- namespace redream{
- WaitableStateBase::WaitableStateBase()
- : _fatherTree(nullptr)
- , _reboltManager(nullptr)
- , _runningState(RunningState())
- {
- }
- void WaitableStateBase::onSuccessEnd(){
- _runningState.btState = ReboltRedManagerBTState::SUCCESS;
- _fatherTree->updateBySubTree();
- }
- void WaitableStateBase::onFailureEnd(){
- _runningState.btState = ReboltRedManagerBTState::FAILURE;
- _fatherTree->updateBySubTree();
- }
- void WaitableStateBase::setFatherTree(red::RedBehaviacTree* ft){
- _fatherTree = ft;
- }
- void WaitableStateBase::setReboltRedManager(ReboltRedManager* rm){
- _reboltManager = rm;
- }
- };
|