feat: Add inventory and item components (#48)

This commit is contained in:
demenik
2025-11-27 17:47:10 +01:00
parent 8c04f0e484
commit afe3b97894
5 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
use crate::prelude::*;
#[derive(Component)]
pub struct Item;
#[derive(Resource, Default)]
pub struct Inventory {
pub items: Vec<Entity>,
}

View File

@@ -0,0 +1,11 @@
use crate::prelude::*;
pub mod components;
pub struct InventoryPlugin;
impl Plugin for InventoryPlugin {
fn build(&self, app: &mut App) {
app.init_resource::<Inventory>();
}
}

View File

@@ -3,6 +3,7 @@ pub mod core;
pub mod game_screen;
pub mod grid;
pub mod input;
pub mod inventory;
pub mod phase;
pub mod pom;
pub mod savegame;
@@ -14,6 +15,7 @@ pub use core::CorePlugin;
pub use game_screen::GameScreenPlugin;
pub use grid::GridPlugin;
pub use input::InputPlugin;
pub use inventory::InventoryPlugin;
pub use phase::PhasePlugin;
pub use pom::PomPlugin;
pub use savegame::SavegamePlugin;

View File

@@ -32,6 +32,7 @@ fn main() {
features::StatusPlugin,
features::SavegamePlugin,
features::UiPlugin,
features::InventoryPlugin,
))
.insert_resource(config)
.run();

View File

@@ -7,6 +7,7 @@ pub use crate::features::{
consts::TILE_SIZE,
utils::{grid_to_world_coords, world_to_grid_coords},
},
inventory::components::{Inventory, Item},
phase::components::{CurrentPhase, Phase},
pom::{
components::{GridPosition, MovingState, Pom},