diff options
author | tom barrett <spalf0@gmail.com> | 2018-02-22 04:32:51 -0600 |
---|---|---|
committer | tom barrett <spalf0@gmail.com> | 2018-02-22 04:32:51 -0600 |
commit | c8d308a566c9e3e5be85e0e67082a06c3420a72b (patch) | |
tree | dbbd0ce6581a60a44b8dc978abc435829d874e0d /src/mass.rs | |
parent | 763653a32e62134a7e394c349d742636b0662a94 (diff) |
-got now a trait which resembles polymorphism for new objects
Diffstat (limited to 'src/mass.rs')
-rw-r--r-- | src/mass.rs | 7 |
1 files changed, 7 insertions, 0 deletions
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; +} |