Add difficult terrain support for pathfinding on gridded scenes

This commit is contained in:
Manuel Vögele
2022-05-10 08:39:19 +02:00
parent 5904efbdd5
commit 445c03d29a
7 changed files with 171 additions and 25 deletions
+9
View File
@@ -1,4 +1,5 @@
use js_sys::Array;
use sha1::{Sha1, Digest};
use wasm_bindgen::prelude::*;
use crate::{
@@ -262,6 +263,14 @@ pub fn debug_get_pathfinding_points(pathfinder: &Pathfinder) -> Array {
.collect()
}
#[allow(dead_code)]
#[wasm_bindgen]
pub fn sha1(input: &str) -> String {
let mut hasher = Sha1::new();
hasher.update(input);
format!("{:x}", hasher.finalize())
}
trait IteratePath {
fn iter_path(&self) -> PathIterator;
}