add doc
All checks were successful
Rust Checks / checks (push) Successful in 24s

This commit is contained in:
CoCo_Sol 2024-02-11 23:39:52 +01:00
parent ac1fb70b32
commit 9f78f7be49

View file

@ -5,21 +5,30 @@ use bevy::ecs::component;
use noise::{NoiseFn, Perlin};
/// The different types of tiles in the map.
#[derive(Clone, Copy, component::Component, Debug, PartialEq, Eq)]
enum Tile {
/// The forest tile.
Forest,
/// The hill tile.
Hill,
/// The grass tile (nothing).
Grass,
}
/// Postion component of tile in the map.
#[derive(component::Component, Debug)]
struct Position(f64, f64);
/// Adjacent entities of tile in the map.
#[derive(component::Component)]
struct AdjacentCases {
entities: Vec<Entity>,
}
/// Generate the map coordinates with a size.
fn generate_map_coordinates(size: i32) -> Vec<Vec<(f64, f64)>> {
let mut all_tiles = Vec::new();
// Iterate over horizontal lines of the map