rust/hwphysics/src/common.rs
author alfadur
Thu, 25 Jul 2019 00:05:30 +0300
changeset 15284 24828281c9c5
parent 15141 febccab419b1
child 15295 42b710b0f883
permissions -rw-r--r--
reserve zero gear id

pub type GearId = std::num::NonZeroU16;
pub trait GearData {}

pub trait GearDataProcessor<T: GearData> {
    fn add(&mut self, gear_id: GearId, gear_data: T);
}

pub trait GearDataAggregator<T: GearData> {
    fn find_processor(&mut self) -> &mut GearDataProcessor<T>;
}