optimize path finding

This commit is contained in:
2024-10-12 12:48:14 -04:00
parent 06ffb2bd3e
commit 3531f9f68f
7 changed files with 117 additions and 37 deletions

View File

@@ -1,4 +1,4 @@
use bevy::prelude::Resource;
use bevy::prelude::*;
use ordered_float::OrderedFloat;
use world_generation::{hex_utils::HexCoord, prelude::Map};
@@ -79,6 +79,11 @@ impl NavData {
}
}
}
pub fn update_tile(&mut self, coord: &HexCoord, height: f32, move_cost: f32) {
let tile = &mut self.tiles[coord.to_index(self.map_width)];
tile.move_cost = move_cost;
tile.height = height;
}
}
#[derive(Clone)]