Skip to content

Commit ddd89cb

Browse files
committed
Fix up all the examples to use the new tick FnMut ordering.
1 parent 8d416dd commit ddd89cb

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

examples/src/3d/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ fn game_tick(
9696
let mut last_pos = mouse_pos(0.0, 0.0);
9797
// update state of behaviosuccessr tree
9898
#[rustfmt::skip]
99-
bt.tick(&e,&mut |args: bonsai_bt::ActionArgs<Event, Animation>, _|
100-
match *args.action {
99+
bt.tick(&e,&mut |action, _, args: bonsai_bt::ActionArgs<Event>|
100+
match *action {
101101
Animation::LongerThan(dur) => {
102102
if t > dur {
103103
(Status::Success, args.dt)

examples/src/async_drone/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ async fn drone_tick(
5050

5151
// update state of behaviosuccessr tree
5252
#[rustfmt::skip]
53-
bt.tick(&e,&mut |args: bonsai_bt::ActionArgs<Event, DroneAction>, _|
54-
match *args.action {
53+
bt.tick(&e,&mut |action, _, args: bonsai_bt::ActionArgs<Event>|
54+
match *action {
5555
DroneAction::AvoidOthers => {
5656
let avoid_state = &drone_state.avoid_others;
5757
if let Some(avoid_status) = avoid_state {

examples/src/boids/boid.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ pub fn game_tick(dt: f32, cursor: mint::Point2<f32>, boid: &mut Boid, other_boid
6565
let win_height: f32 = *db.get("win_height").unwrap();
6666

6767
#[rustfmt::skip]
68-
bt.tick(&e,&mut |args: bonsai_bt::ActionArgs<Event, Action>, _| {
69-
match args.action {
68+
bt.tick(&e,&mut |action, _, args: bonsai_bt::ActionArgs<Event>| {
69+
match action {
7070
Action::AvoidOthers => {
7171
let avoid_factor = 0.5;
7272
let mut move_x = 0.0;

examples/src/simple_npc_ai/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ fn game_tick(bt: &mut BT<EnemyNPC, BlackBoardData>, state: &mut EnemyNPCState) -
1515
let e: Event = UpdateArgs { dt: 0.0 }.into();
1616

1717
#[rustfmt::skip]
18-
let status = bt.tick(&e, &mut |args: bonsai_bt::ActionArgs<Event, EnemyNPC>, blackboard| {
19-
match *args.action {
18+
let status = bt.tick(&e, &mut |action, blackboard, args: bonsai_bt::ActionArgs<Event>| {
19+
match *action {
2020
EnemyNPC::Run => {
2121
state.perform_action("run");
2222
(Success, 0.0)

0 commit comments

Comments
 (0)