summaryrefslogtreecommitdiff
path: root/src/mass.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/mass.rs')
-rw-r--r--src/mass.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mass.rs b/src/mass.rs
index 30442ec..d6feb6c 100644
--- a/src/mass.rs
+++ b/src/mass.rs
@@ -7,9 +7,18 @@ pub trait Mass : Any {
fn process(&mut self);
fn slow(&mut self);
fn give_acceleration(&mut self, acceleration : (f64, f64, f64));
+ fn box_clone(&self) -> Box<Mass>;
+ fn range(&self) -> f64;
+ fn give_target(&mut self, target : Option<usize>);
}
-#[derive(Serialize, Deserialize, Debug)]
+impl Clone for Box<Mass> {
+ fn clone(&self) -> Box<Mass> {
+ self.box_clone()
+ }
+}
+
+#[derive(Serialize, Deserialize, Debug, Clone)]
pub enum Type {
Ship,
Astroid,