diff options
Diffstat (limited to 'src/mass.rs')
-rw-r--r-- | src/mass.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mass.rs b/src/mass.rs index d1f9d3e..955f84d 100644 --- a/src/mass.rs +++ b/src/mass.rs @@ -1,7 +1,11 @@ -pub trait Mass { +use downcast::Any; + +pub trait Mass : Any { fn new(name : &str, location : (isize, isize, isize)) -> Self where Self: Sized; - fn get_name(&self) -> &String; - fn get_location(&self) -> (isize, isize, isize); - fn give_location(&mut self, location : (isize, isize, isize)); + fn name(&self) -> &String; + fn location(&self) -> (isize, isize, isize); + fn set_location(&mut self, location : (isize, isize, isize)); fn serialize(&self) -> String; } + +downcast!(Mass); |