pub struct Clock {
pub minutes: f64,
pub calendar: Calendar,
}Expand description
The game clock.
Fields§
§minutes: f64Game minutes since 00:00 on day 0. It can be fractional.
calendar: CalendarThe calendar the game runs on.
Implementations§
Source§impl Clock
impl Clock
Sourcepub fn minute_of_day(&self) -> f64
pub fn minute_of_day(&self) -> f64
Minutes since midnight, 0 up to 1,440.
Sourcepub fn day_of_week(&self) -> i64
pub fn day_of_week(&self) -> i64
The day of the week, from 0 to week_days - 1; the weekend is last.
Sourcepub fn is_weekend(&self) -> bool
pub fn is_weekend(&self) -> bool
Whether today is a weekend day.
Sourcepub fn is_weekend_on(&self, day: i64) -> bool
pub fn is_weekend_on(&self, day: i64) -> bool
Whether day (a day number, as day() gives) falls on a weekend.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Clock
impl RefUnwindSafe for Clock
impl Send for Clock
impl Sync for Clock
impl Unpin for Clock
impl UnsafeUnpin for Clock
impl UnwindSafe for Clock
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more