@@ -3,15 +3,15 @@ use crate::sequence::{sequence, SequenceArgs};
33use crate :: state:: State :: * ;
44use crate :: status:: Status :: * ;
55use crate :: when_all:: when_all;
6- use crate :: { Behavior , Status } ;
6+ use crate :: { Behavior , Float , Status } ;
77use std:: fmt:: Debug ;
88
99#[ cfg( feature = "serde" ) ]
1010use serde:: { Deserialize , Serialize } ;
1111
1212/// The action is still running, and thus the action consumes
1313/// all the remaining delta time for the tick
14- pub const RUNNING : ( Status , f64 ) = ( Running , 0.0 ) ;
14+ pub const RUNNING : ( Status , Float ) = ( Running , 0.0 ) ;
1515
1616/// The arguments in the action callback.
1717pub struct ActionArgs < ' a , E : ' a , A : ' a > {
@@ -20,7 +20,7 @@ pub struct ActionArgs<'a, E: 'a, A: 'a> {
2020 /// The remaining delta time. When one action terminates,
2121 /// it can consume some of dt and the remaining is passed
2222 /// onto the next action.
23- pub dt : f64 ,
23+ pub dt : Float ,
2424 /// The action running.
2525 pub action : & ' a A ,
2626}
@@ -36,7 +36,7 @@ pub(crate) enum State<A> {
3636 /// Ignores failures and always return `Success`.
3737 AlwaysSucceed ( Box < State < A > > ) ,
3838 /// Keeps track of waiting for a period of time before continuing.
39- Wait { time_to_wait : f64 , elapsed_time : f64 } ,
39+ Wait { time_to_wait : Float , elapsed_time : Float } ,
4040 /// Waits forever.
4141 WaitForever ,
4242 /// Keeps track of an `If` behavior.
@@ -196,14 +196,14 @@ impl<A: Clone> State<A> {
196196 /// Passes event, delta time in seconds, action and state to closure.
197197 /// The closure should return a status and remaining delta time.
198198 ///
199- /// return: (Status, f64 )
199+ /// return: (Status, Float )
200200 /// function returns the result of the tree traversal, and how long
201201 /// it actually took to complete the traversal and propagate the
202202 /// results back up to the root node
203- pub fn tick < E , F , B > ( & mut self , e : & E , blackboard : & mut B , f : & mut F ) -> ( Status , f64 )
203+ pub fn tick < E , F , B > ( & mut self , e : & E , blackboard : & mut B , f : & mut F ) -> ( Status , Float )
204204 where
205205 E : UpdateEvent ,
206- F : FnMut ( ActionArgs < E , A > , & mut B ) -> ( Status , f64 ) ,
206+ F : FnMut ( ActionArgs < E , A > , & mut B ) -> ( Status , Float ) ,
207207 {
208208 let upd = e. update ( |args| Some ( args. dt ) ) . unwrap_or ( None ) ;
209209
@@ -413,7 +413,7 @@ impl<A: Clone> State<A> {
413413 ) => {
414414 // println!("In AfterState: {}", next_success_index);
415415 // Get the least delta time left over.
416- let mut min_dt = f64 :: MAX ;
416+ let mut min_dt = Float :: MAX ;
417417 for ( j, item) in states. iter_mut ( ) . enumerate ( ) . skip ( * next_success_index) {
418418 match item. tick ( e, blackboard, f) {
419419 ( Running , _) => {
0 commit comments