blob: 30442ec24184bd4c6368eaa0febf95ca89b6c1c0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
use downcast::Any;
pub trait Mass : Any {
fn name(&self) -> &String;
fn position(&self) -> (f64, f64, f64);
fn serialize(&self) -> String;
fn process(&mut self);
fn slow(&mut self);
fn give_acceleration(&mut self, acceleration : (f64, f64, f64));
}
#[derive(Serialize, Deserialize, Debug)]
pub enum Type {
Ship,
Astroid,
}
downcast!(Mass);
|