use async_trait::async_trait;
use crate::errors::my_errors::RetResult;
use crate::map::IndexType;
pub type MapType = std::sync::Arc<std::sync::RwLock<dyn Map>>;
#[async_trait]
pub trait Map: Send + Sync {
fn new() -> MapType
where
Self: Sized;
fn load(&mut self, points: Vec<Vec<i32>>) -> RetResult<()>;
async fn load_from_file(&mut self, file_name: String) -> RetResult<()>;
async fn load_from_string(&mut self, file_contend: String) -> RetResult<()>;
fn find_path(
&self,
start: (IndexType, IndexType),
end: (IndexType, IndexType),
) -> Vec<(IndexType, IndexType)>;
fn set_walkable(
&mut self,
point: (IndexType, IndexType),
walkable: i32,
);
fn in_map(&self, x: i32, y: i32) -> bool;
}