rust/hwphysics/src/common.rs
author Wuzzy <Wuzzy2@mail.ru>
Sat, 15 Jun 2019 12:58:01 +0200
changeset 15151 6b7d92fa4912
parent 15125 febccab419b1
child 15268 24828281c9c5
permissions -rw-r--r--
Keep hog facing direction while on parachute
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15125
febccab419b1 Apply dos2unix to rust sources
unc0rr
parents: 14184
diff changeset
     1
pub type GearId = u16;
febccab419b1 Apply dos2unix to rust sources
unc0rr
parents: 14184
diff changeset
     2
pub trait GearData {}
febccab419b1 Apply dos2unix to rust sources
unc0rr
parents: 14184
diff changeset
     3
febccab419b1 Apply dos2unix to rust sources
unc0rr
parents: 14184
diff changeset
     4
pub trait GearDataProcessor<T: GearData> {
febccab419b1 Apply dos2unix to rust sources
unc0rr
parents: 14184
diff changeset
     5
    fn add(&mut self, gear_id: GearId, gear_data: T);
febccab419b1 Apply dos2unix to rust sources
unc0rr
parents: 14184
diff changeset
     6
}
febccab419b1 Apply dos2unix to rust sources
unc0rr
parents: 14184
diff changeset
     7
febccab419b1 Apply dos2unix to rust sources
unc0rr
parents: 14184
diff changeset
     8
pub trait GearDataAggregator<T: GearData> {
febccab419b1 Apply dos2unix to rust sources
unc0rr
parents: 14184
diff changeset
     9
    fn find_processor(&mut self) -> &mut GearDataProcessor<T>;
febccab419b1 Apply dos2unix to rust sources
unc0rr
parents: 14184
diff changeset
    10
}