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:
2025-08-29 09:54:27 -05:00
parent f470687494
commit 4a80b4f4ad
2 changed files with 11 additions and 2 deletions

View File

@@ -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;
}