From 3d3864171785c589872bf23faaaa3a421f56ee4e Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Wed, 22 Apr 2026 10:51:13 -0400 Subject: complete orbit camera. add most large solar bodies --- src/timeman.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/timeman.rs') diff --git a/src/timeman.rs b/src/timeman.rs index 9d17999..32a6f45 100644 --- a/src/timeman.rs +++ b/src/timeman.rs @@ -4,14 +4,18 @@ use std::{fmt::Display, string}; use std::error::Error; use crate::GameState; -use crate::window::ui::GameWindowUiState; pub type Second = u64; +pub const MINUTE: Second = 60; +pub const HOUR: Second = MINUTE * 60; +pub const DAY: Second = HOUR * 24; +pub const YEAR: Second = DAY * 365; + pub struct TimeMan { time: Second, - auto_tick: Option + pub auto_tick: Option } impl TimeMan @@ -58,11 +62,11 @@ impl TimeMan } format!("{}{}{}{}{}", - if seconds > 0 { format!("{}s", seconds) } else { format!("") }, - if minutes > 0 { format!("{}m", minutes) } else { format!("") }, - if hours > 0 { format!("{}h", hours) } else { format!("") }, + if years > 0 { format!("{}y", years) } else { format!("") }, if days > 0 { format!("{}d", days) } else { format!("") }, - if years > 0 { format!("{}y", years) } else { format!("") }) + if hours > 0 { format!("{}h", hours) } else { format!("") }, + if minutes > 0 { format!("{}m", minutes) } else { format!("") }, + if seconds > 0 { format!("{}s", seconds) } else { format!("") }) } -- cgit v1.2.3