feat: Add inventory and item components (#48)
This commit is contained in:
9
src/features/inventory/components.rs
Normal file
9
src/features/inventory/components.rs
Normal file
@@ -0,0 +1,9 @@
|
||||
use crate::prelude::*;
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct Item;
|
||||
|
||||
#[derive(Resource, Default)]
|
||||
pub struct Inventory {
|
||||
pub items: Vec<Entity>,
|
||||
}
|
||||
11
src/features/inventory/mod.rs
Normal file
11
src/features/inventory/mod.rs
Normal 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>();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -32,6 +32,7 @@ fn main() {
|
||||
features::StatusPlugin,
|
||||
features::SavegamePlugin,
|
||||
features::UiPlugin,
|
||||
features::InventoryPlugin,
|
||||
))
|
||||
.insert_resource(config)
|
||||
.run();
|
||||
|
||||
@@ -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},
|
||||
|
||||
Reference in New Issue
Block a user