WaitableStateBase.cpp 775 B

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // WaitableStateBase.cpp
  3. // redream_runtime
  4. //
  5. // Created by zhu on 2023/5/24.
  6. //
  7. #include "WaitableStateBase.hpp"
  8. #include "behaviac/RedBehaviacTree.h"
  9. namespace redream{
  10. WaitableStateBase::WaitableStateBase()
  11. : _fatherTree(nullptr)
  12. , _reboltManager(nullptr)
  13. , _runningState(RunningState())
  14. {
  15. }
  16. void WaitableStateBase::onSuccessEnd(){
  17. _runningState.btState = ReboltRedManagerBTState::SUCCESS;
  18. _fatherTree->updateBySubTree();
  19. }
  20. void WaitableStateBase::onFailureEnd(){
  21. _runningState.btState = ReboltRedManagerBTState::FAILURE;
  22. _fatherTree->updateBySubTree();
  23. }
  24. void WaitableStateBase::setFatherTree(red::RedBehaviacTree* ft){
  25. _fatherTree = ft;
  26. }
  27. void WaitableStateBase::setReboltRedManager(ReboltRedManager* rm){
  28. _reboltManager = rm;
  29. }
  30. };