summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mass.rs10
-rw-r--r--src/server/mining.rs4
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;
}
_ => (),
}