diff options
author | tom barrett <spalf0@gmail.com> | 2018-04-17 02:36:11 -0500 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2018-04-17 02:36:11 -0500 |
commit | 07b0ba697bff4209907f6abb734fb52a889753e9 (patch) | |
tree | 661611e45791e6f9b44c56aa08c4a4cd8f32711c | |
parent | 7da5495fc815c2cf255b03f100a5b800a5e5f0ff (diff) |
-added Iron to astroids
-rw-r--r-- | src/mass.rs | 10 | ||||
-rw-r--r-- | src/server/mining.rs | 4 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/mass.rs b/src/mass.rs index f38ab6d..f1ac1b2 100644 --- a/src/mass.rs +++ b/src/mass.rs @@ -4,6 +4,7 @@ use std::collections::HashMap; use self::rand::distributions::Range; use self::rand::distributions::Sample; +use item::Item; use storage::Storage; use module::Module; @@ -35,8 +36,15 @@ impl Mass { let mut vr = Range::new(-0.5, 0.5); let velocity = (vr.sample(&mut rng), vr.sample(&mut rng), vr.sample(&mut rng)); + let mut rr = Range::new(0, 20); + let mut resources = Vec::new(); + for _ in 0..rr.sample(&mut rng) { + resources.push(Item::new("Iron", 1)); + } + + let astroid = MassType::Astroid { - resources : Storage::new(Vec::new()), + resources : Storage::new(resources), }; Mass { diff --git a/src/server/mining.rs b/src/server/mining.rs index 2364f9f..fd8b6ff 100644 --- a/src/server/mining.rs +++ b/src/server/mining.rs @@ -30,8 +30,8 @@ impl ServerConnection { match modules.get("Mining").unwrap().module_type { ModuleType::Mining{ref range, ref status, ..} => { - mining_range = range.clone(); - mining_status = status.clone(); + mining_range = *range; + mining_status = *status; } _ => (), } |