Struct ticktime::TickTime [−][src]
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]
current_tick: usize,
options: TickTimeOptions
) -> Result<Self, &'static str>
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
Auto Trait Implementations
impl RefUnwindSafe for TickTime
impl Send for TickTime
impl Sync for TickTime
impl Unpin for TickTime
impl UnwindSafe for TickTime
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,