From 233aa5d803e8015f78f663bc9af6bb33e56eb96e Mon Sep 17 00:00:00 2001 From: tom barrett Date: Thu, 1 Mar 2018 03:51:36 -0600 Subject: -added copying of mass vector, fixed buildmass bug, and allow giving of target --- src/mass.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/mass.rs') 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; + fn range(&self) -> f64; + fn give_target(&mut self, target : Option); } -#[derive(Serialize, Deserialize, Debug)] +impl Clone for Box { + fn clone(&self) -> Box { + self.box_clone() + } +} + +#[derive(Serialize, Deserialize, Debug, Clone)] pub enum Type { Ship, Astroid, -- cgit v1.2.3