Struct ticktime::TickTime[][src]

pub struct TickTime { /* fields omitted */ }

A TickTime helps to keep track of the current tick in the game. Following a TickTimeType, it will translate the current tick to a list of computed values, representing year, season, month…

Implementations

impl TickTime[src]

pub fn init(
    current_tick: usize,
    options: TickTimeOptions
) -> Result<Self, &'static str>
[src]

Initialise a TickTime with a given tick (usefull to reload the state of a save) and a TickTimeType.

pub fn tick(&mut self) -> Option<TickTimeEvent>[src]

Add a tick to the current_tick. Will also compute values

pub fn values(&self) -> (usize, usize, usize, usize, usize, usize, usize, usize)[src]

Return a tuple of computed usizes for (year, season, month, day, hour, minute, second)

pub fn current_tick(&self) -> usize[src]

Total tick count

pub fn year(&self) -> usize[src]

Return the read only computed year

pub fn month(&self) -> usize[src]

Return the read only computed month

pub fn season(&self) -> usize[src]

Return the read only computed season

pub fn week(&self) -> usize[src]

Return the read only computed week

pub fn day(&self) -> usize[src]

Return the read only computed day

pub fn hour(&self) -> usize[src]

Return the read only computed hour

pub fn minute(&self) -> usize[src]

Return the read only computed minute

pub fn second(&self) -> usize[src]

Return the read only computed second

Trait Implementations

impl Clone for TickTime[src]

impl Debug for TickTime[src]

impl Display for TickTime[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.