added path finding

This commit is contained in:
2024-10-05 13:29:42 -04:00
parent 5e7ab32138
commit 06ffb2bd3e
12 changed files with 136 additions and 70 deletions

View File

@@ -180,9 +180,9 @@ impl Map {
assert!(radius != 0, "Radius cannot be zero");
let mut result = if include_center {
Vec::with_capacity(get_tile_count(radius) + 1)
Vec::with_capacity(get_tile_count_in_range(radius) + 1)
} else {
Vec::with_capacity(get_tile_count(radius))
Vec::with_capacity(get_tile_count_in_range(radius))
};
if include_center {
let h = self.sample_height(&center);
@@ -218,9 +218,9 @@ impl Map {
assert!(radius != 0, "Radius cannot be zero");
let mut result = if include_center {
Vec::with_capacity(get_tile_count(radius) + 1)
Vec::with_capacity(get_tile_count_in_range(radius) + 1)
} else {
Vec::with_capacity(get_tile_count(radius))
Vec::with_capacity(get_tile_count_in_range(radius))
};
if include_center {
let h = self.sample_height_mut(&center);