diff options
author | tom barrett <spalf0@gmail.com> | 2019-02-12 13:20:06 -0600 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2019-02-12 13:20:06 -0600 |
commit | 070485e093dc540a5db9650d438cffe3d18d3883 (patch) | |
tree | a0ab1f42c844b3557c7f17b11f3c7eae334e853d /src/bin | |
parent | 6a906ce663935e37d6dd79a2e2e31fb07ca7c2af (diff) |
added constants file, made so items are referred to by an enum, figured better ways than ship_clone
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/server.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/server.rs b/src/bin/server.rs index ea961b7..0429224 100644 --- a/src/bin/server.rs +++ b/src/bin/server.rs @@ -5,6 +5,7 @@ use std::net::TcpListener; use std::thread::sleep; use std::time::Duration; +use space::constants; use space::mass::Mass; use space::math::rand_name; use space::server::connection::ServerConnection; @@ -12,7 +13,7 @@ use space::server::connection::ServerConnection; fn populate() -> HashMap<String, Mass> { let mut masses: HashMap<String, Mass> = HashMap::new(); - for _ in 0..10 { + for _ in 0..constants::ASTROID_COUNT { masses.insert(rand_name(), Mass::new_astroid()); } @@ -48,7 +49,7 @@ fn main() { mass.process(); } - sleep(Duration::from_millis(100)); + sleep(Duration::from_millis(constants::SLEEP_DURATION)); } } } |