primitives/prelude/traits/updateable.rs
1/// The Updatable should be implemented by any object wishing to enter the broad phase update traversal stack.
2///
3pub trait Updateable {
4 /// The age of the object.
5 ///
6 /// # Arguments
7 ///
8 /// * `as_time` - If true treats the time as milliseconds, otherwise as frame updates. (optional, default true)
9 ///
10 /// Return: The age of the object (as elapsed time, not time since birth).
11 ///
12 fn age(&self, as_time: Option<bool>) -> i32;
13
14 /// Used to modify the internal state according to object specific logic and the elapsed time.
15 /// This method is called internally by the framework, it will rarely need to be called directly.
16 ///
17 /// # Arguments
18 ///
19 /// * `deltaTime` - The time elapsed between this update and the previous update.
20 /// Can be used to accurately influence rate of change - e.g. speed. (optional, default: 0)
21 ///
22 fn update(&self, delta_time: Option<i32>);
23}