Skip to content

Commit fef1677

Browse files
committed
增加时间
1 parent 5a7b03c commit fef1677

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

include/behaviortree_cpp_v3/config.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#ifdef Ivy
99

1010
#include "common/Sys.h"
11+
#include "tool/system.h"
1112
#include "Body/Skin.h"
1213
#include "Anim/IvyAnim.h"
1314
#include "Engine/Behavior/EventDispatcher.h"
@@ -117,6 +118,18 @@ namespace BT {
117118
case emotion_status:
118119
value = IvyBehavior::instance().get_current_emo_status();
119120
break;
121+
case timestamp:
122+
if (Sys::check_condition(Sys::TIME_SYNCHRONIZED))
123+
value = get_ymdh(Sys::get_geo_info().timestamp);
124+
else
125+
value = 9999999999;
126+
break;
127+
case date_time:
128+
if (Sys::check_condition(Sys::TIME_SYNCHRONIZED))
129+
value = get_mdh(Sys::get_geo_info().timestamp);
130+
else
131+
value = 999999;
132+
break;
120133
default:
121134
return false;
122135
}

include/behaviortree_cpp_v3/config_implt.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ namespace BT {
2929
water_change = 14, /* 水位状态变更 */
3030
temp_change = 15, /* 温度状态变更 */
3131

32+
sun_up_fast = 16, /* 光照突然变高 */
33+
sun_down_fast = 17, /* 光照突然变低 */
34+
3235
trans_manager = 101,
3336
};
3437

@@ -60,6 +63,9 @@ namespace BT {
6063
batt_status = 13, /* 当前电池状态 */
6164
loneliness = 14, /* 孤独值 */
6265
emotion_status =15, /* 情感状态 */
66+
timestamp = 16, /* 时间戳 */
67+
date_time = 17, /* 月日时 */
68+
6369
};
6470

6571
/* todo

0 commit comments

Comments
 (0)