behavior3行为树
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
623 B

  1. %%%-------------------------------------------------------------------
  2. %%% @author DY
  3. %%% @copyright (C) 2020, <COMPANY>
  4. %%% @doc
  5. %%% 判断是否处于恢复状态
  6. %%% 是:SUCCESS
  7. %%% 否:FAILURE
  8. %%% @end
  9. %%% Created : 07. 10月 2020 15:13
  10. %%%-------------------------------------------------------------------
  11. -module(cond_is_recovering).
  12. -include("eBhv3.hrl").
  13. -include("example.hrl").
  14. %% API
  15. -export([tick/2]).
  16. tick(_BTree, #{cur_state := CurState} = State) ->
  17. case ?IS_STATE(?STATE_TYPE_RECOVERING, CurState) of
  18. true ->
  19. {?BT_SUCCESS, State};
  20. false ->
  21. {?BT_FAILURE, State}
  22. end.