Proof-of-concept for fuel change event handling
Added a `FuelChanged` event which is to be used to trigger Observers watching for a machine's fuel level change. I've written a slapdash observer to emit these events when the cutting machine's big red button is pressed. That observer *must* be replaced because of how it feeds the machine ID into the UI (it only works when there is exactly 1 CuttingMachine, which won't be the case). The dummy machines are missing their machine components. I've added the `CuttingMachine` component to the cutting machine just to test the event passing.
This commit is contained in:
@@ -34,4 +34,7 @@ pub mod consumables {
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct Fuel(u32);
|
||||
|
||||
#[derive(Event)]
|
||||
pub struct FuelChanged;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user