[−][src]Struct game_time::clock::GameClockBuilder
A GameClock
builder,
allowing for customization of the initial time and parameters.
GameClockBuilder
offers fine control over the initial state of a GameClock
. For
most cases, using GameClock::new()
is good enough.
However, it can be useful to have more control in some situations, especially testing.
Methods
impl GameClockBuilder
[src]
impl GameClockBuilder
pub fn new() -> GameClockBuilder
[src]
pub fn new() -> GameClockBuilder
Construct a new GameClockBuilder
with default values.
Calling build
on the returned object returns immediately gives the same
result as GameClock::new()
.
pub fn start_game_time(&mut self, time: Duration) -> &mut GameClockBuilder
[src]
pub fn start_game_time(&mut self, time: Duration) -> &mut GameClockBuilder
Set the initial game time when the game is started.
Defaults to zero.
pub fn start_wall_time(
&mut self,
time: DateTime<Local>
) -> &mut GameClockBuilder
[src]
pub fn start_wall_time(
&mut self,
time: DateTime<Local>
) -> &mut GameClockBuilder
Set the initial wall time when the game is started.
Defaults to chrono::Local::now()
.
pub fn start_frame(&mut self, frame_num: u64) -> &mut GameClockBuilder
[src]
pub fn start_frame(&mut self, frame_num: u64) -> &mut GameClockBuilder
Set the initial frame number.
Defaults to 0
.
pub fn clock_multiplier(&mut self, multiplier: f64) -> &mut GameClockBuilder
[src]
pub fn clock_multiplier(&mut self, multiplier: f64) -> &mut GameClockBuilder
Set the initial clock multiplier.
Defaults to 1.0
.
pub fn build(&self) -> GameClock
[src]
pub fn build(&self) -> GameClock
Construct a GameClock
object with the set parameters.
Trait Implementations
impl Default for GameClockBuilder
[src]
impl Default for GameClockBuilder
fn default() -> GameClockBuilder
[src]
fn default() -> GameClockBuilder
impl Clone for GameClockBuilder
[src]
impl Clone for GameClockBuilder
fn clone(&self) -> GameClockBuilder
[src]
fn clone(&self) -> GameClockBuilder
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for GameClockBuilder
[src]
impl Debug for GameClockBuilder
Auto Trait Implementations
impl Send for GameClockBuilder
impl Send for GameClockBuilder
impl Sync for GameClockBuilder
impl Sync for GameClockBuilder
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T, U> IntoDuration for T where
U: FromDuration<T>,
[src]
impl<T, U> IntoDuration for T where
U: FromDuration<T>,
type Error = <U as FromDuration<T>>::Error
fn into_duration(self) -> Result<U, <U as FromDuration<T>>::Error>
[src]
fn into_duration(self) -> Result<U, <U as FromDuration<T>>::Error>