veloren/common/src/time.rs

14 lines
248 B
Rust
Raw Normal View History

2020-08-30 12:25:54 +00:00
#[derive(Copy, Clone, PartialEq, Eq)]
pub enum DayPeriod {
Night,
Morning,
Noon,
Evening,
}
impl DayPeriod {
2020-09-03 18:06:06 +00:00
pub fn is_dark(&self) -> bool { *self == DayPeriod::Night }
2020-08-30 12:25:54 +00:00
2020-09-03 18:06:06 +00:00
pub fn is_light(&self) -> bool { !self.is_dark() }
2020-08-30 12:25:54 +00:00
}