From c8d308a566c9e3e5be85e0e67082a06c3420a72b Mon Sep 17 00:00:00 2001 From: tom barrett Date: Thu, 22 Feb 2018 04:32:51 -0600 Subject: -got now a trait which resembles polymorphism for new objects --- src/mass.rs | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/mass.rs (limited to 'src/mass.rs') diff --git a/src/mass.rs b/src/mass.rs new file mode 100644 index 0000000..d1f9d3e --- /dev/null +++ b/src/mass.rs @@ -0,0 +1,7 @@ +pub trait Mass { + 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 serialize(&self) -> String; +} -- cgit v1.2.3