From 9f78f7be49536af936ac9cdb3174640a3c378e1b Mon Sep 17 00:00:00 2001 From: CoCoSol007 Date: Sun, 11 Feb 2024 23:39:52 +0100 Subject: [PATCH] add doc --- crates/border-wars/src/map.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crates/border-wars/src/map.rs b/crates/border-wars/src/map.rs index 46d1f43..314f77c 100644 --- a/crates/border-wars/src/map.rs +++ b/crates/border-wars/src/map.rs @@ -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, } +/// Generate the map coordinates with a size. fn generate_map_coordinates(size: i32) -> Vec> { let mut all_tiles = Vec::new(); // Iterate over horizontal lines of the map