behavior3行为树
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

23 rader
600 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:18
  10. %%%-------------------------------------------------------------------
  11. -module(cond_is_rage_full).
  12. -include("eBhv3.hrl").
  13. -include("example.hrl").
  14. %% API
  15. -export([tick/2]).
  16. tick(_BTree, #{cur_rage := CurRage} = State) ->
  17. case CurRage >= ?MAX_RAGE of
  18. true ->
  19. {?BT_SUCCESS, State};
  20. false ->
  21. {?BT_FAILURE, State}
  22. end.