This commit is contained in:
2025-09-14 19:04:34 +01:00
parent 4c4c985be3
commit 975ac20876
3 changed files with 24 additions and 14 deletions
+2 -6
View File
@@ -6,7 +6,7 @@ use crate::{entities::item::Item, game};
#[derive(Resource, Default, Clone)]
pub struct TileMap {
pub floor_tiles: HashMap<IVec3, (i32, bool, bool, bool, i32, [u32; 8])>, //id, canStandIn, canStandOn, visiblyTransparent, astar_weight, visible_range
pub fixture_tiles: HashMap<IVec3, (i32, bool, bool, [u32; 8])>, // id, canStandIn, canStandOn, visible_range
pub fixture_tiles: HashMap<IVec3, (i32, bool, bool, [u32; 8])>, // id, canStandIn, canStandOn, visible_range //TODO - consider moving alot of this into the fixtures components
pub item_tiles: HashMap<IVec3, Vec<u32>>, // Entity.id's of items on this tile
}
@@ -25,6 +25,7 @@ impl Default for ItemRotationTimer {
}
}
// TODO - broken, doesnt work with the visibleGameEntity system
pub fn item_tile_management_system(
time: Res<Time>,
mut tilemap: ResMut<TileMap>,
@@ -32,11 +33,6 @@ pub fn item_tile_management_system(
z_index: Res<game::ZIndex>,
mut visibility_query: Query<&mut Visibility, With<Item>>,
) {
println!(
"{} items accross {} tiles",
visibility_query.iter().count(),
tilemap.item_tiles.len()
);
rotation_timer.timer.tick(time.delta());
let mut tiles_to_remove = Vec::new();