This commit is contained in:
CoCo_Sol 2024-02-13 11:33:55 +01:00
parent 24ae64f2f3
commit 952048a9d4
2 changed files with 22 additions and 2 deletions

View file

@ -67,18 +67,37 @@ impl AdjacentsPositions {
} }
} }
/// TODO
#[derive(Component)]
struct AdjacentsLink {
/// TODO
top_left: Option<Entity>,
/// TODO
top_right: Option<Entity>,
/// TODO
bottom_left: Option<Entity>,
/// TODO
bottom_right: Option<Entity>,
/// TODO
left: Option<Entity>,
/// TODO
right: Option<Entity>,
}
/// TODO /// TODO
fn create_adjacent_tiles( fn create_adjacent_tiles(
commands: &mut Commands, commands: &mut Commands,
tile_pos: TilePosition, tile_pos: TilePosition,
tiles: &mut HashMap<TilePosition, Entity>, tiles: &mut HashMap<TilePosition, Entity>,
new_tiles: &mut LinkedList<TilePosition>, new_tiles: &mut LinkedList<TilePosition>,
) { ) -> Entity {
let _entity = *tiles let entity = *tiles
.entry(tile_pos) .entry(tile_pos)
.or_insert_with(|| commands.spawn((Tile, tile_pos)).id()); .or_insert_with(|| commands.spawn((Tile, tile_pos)).id());
new_tiles.push_back(tile_pos); new_tiles.push_back(tile_pos);
entity
} }
fn test(mut commands: Commands, raduis: u32) { fn test(mut commands: Commands, raduis: u32) {

View file

@ -2,6 +2,7 @@
use bevy::prelude::*; use bevy::prelude::*;
pub mod generation;
pub mod scenes; pub mod scenes;
/// The current scene of the game. /// The current scene of the game.