rust/hwphysics/src/common.rs
author Wuzzy <Wuzzy2@mail.ru>
Thu, 10 Jan 2019 19:09:06 +0100
changeset 14543 78363dbfd5dc
parent 14179 abbb74b9cb62
child 15120 febccab419b1
permissions -rw-r--r--
Prevent wind bar from overflowing with high wind values Wind flow overflow does not happen normally, but might be triggered when calling SetWind with extreme values (>100 or <-100). Allows for silly wind experiments in scripts.

pub type GearId = u16;
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>;
}