generated from tipragot/rust
parent
952048a9d4
commit
32e9a1eee2
|
@ -2,6 +2,7 @@
|
|||
|
||||
use std::collections::{HashMap, LinkedList};
|
||||
|
||||
use bevy::ecs::query;
|
||||
use bevy::prelude::*;
|
||||
|
||||
/// TODO
|
||||
|
@ -65,6 +66,16 @@ impl AdjacentsPositions {
|
|||
},
|
||||
}
|
||||
}
|
||||
fn to_vec(&self) -> [TilePosition; 6] {
|
||||
[
|
||||
self.top_left,
|
||||
self.top_right,
|
||||
self.bottom_left,
|
||||
self.bottom_right,
|
||||
self.left,
|
||||
self.right,
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
/// TODO
|
||||
|
@ -100,7 +111,7 @@ fn create_adjacent_tiles(
|
|||
entity
|
||||
}
|
||||
|
||||
fn test(mut commands: Commands, raduis: u32) {
|
||||
fn generate_map(mut commands: Commands, raduis: u32) {
|
||||
let mut tiles = HashMap::new();
|
||||
|
||||
// TODO
|
||||
|
@ -131,6 +142,17 @@ fn test(mut commands: Commands, raduis: u32) {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn setup(commands: Commands) {
|
||||
test(commands, 2)
|
||||
/// TODO
|
||||
fn add_adjacent_tiles(query: Query<(Entity, &TilePosition, With<Tile>)>) {
|
||||
for (entity, postion, _) in query.iter() {
|
||||
let adjacents = AdjacentsPositions::new_from(*postion);
|
||||
for (_, adjacent_position, _) in query.iter() {
|
||||
if adjacents.contains(adjacent_position) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// TODO
|
||||
pub fn setup(commands: Commands) {
|
||||
generate_map(commands, 2)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue