behavior3行为树
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
612 B

%%%-------------------------------------------------------------------
%%% @author DY
%%% @copyright (C) 2020, <COMPANY>
%%% @doc
%%% 判断是否处于空闲状态
%%% 是:SUCCESS
%%% 否:FAILURE
%%% @end
%%% Created : 07. 10月 2020 15:13
%%%-------------------------------------------------------------------
-module(cond_is_idle).
-include("eBhv3.hrl").
-include("example.hrl").
%% API
-export([tick/2]).
tick(_BTree, #{cur_state := CurState} = State) ->
case ?IS_STATE(?STATE_TYPE_IDLE, CurState) of
true ->
{?BT_SUCCESS, State};
false ->
{?BT_FAILURE, State}
end.