Make Fuel a required component on machines
It will be pulled in automatically by Bevy, now. I've also set a default fuel level of 5 units.
This commit is contained in:
@@ -16,16 +16,22 @@ pub mod machines {
|
||||
|
||||
use bevy::prelude::*;
|
||||
|
||||
use crate::game::consumables::Fuel;
|
||||
|
||||
#[derive(Component)]
|
||||
#[require(Fuel)]
|
||||
pub struct CuttingMachine;
|
||||
|
||||
#[derive(Component)]
|
||||
#[require(Fuel)]
|
||||
pub struct RotatingMachine;
|
||||
|
||||
#[derive(Component)]
|
||||
#[require(Fuel)]
|
||||
pub struct FlippingMachine;
|
||||
|
||||
#[derive(Component)]
|
||||
#[require(Fuel)]
|
||||
pub struct TransposingMachine;
|
||||
}
|
||||
|
||||
@@ -35,6 +41,11 @@ pub mod consumables {
|
||||
#[derive(Component)]
|
||||
pub struct Fuel(pub u32);
|
||||
|
||||
impl Default for Fuel {
|
||||
fn default() -> Self {
|
||||
Self(5)
|
||||
}
|
||||
}
|
||||
#[derive(Event)]
|
||||
pub struct FuelChanged;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user