Improve create method

This commit is contained in:
hodasemi 2024-08-27 16:11:24 +02:00
parent 4702c5431b
commit 4d2abde5ca
2 changed files with 2 additions and 2 deletions

View file

@ -20,7 +20,7 @@ use super::{
};
pub trait Ability: Send + Sync + Clone + Default {
fn create(asset_path: impl Into<AssetPath>) -> Result<Self>;
fn create(engine: &Engine, asset_path: impl Into<AssetPath>) -> Result<Self>;
fn name(&self) -> &str;
fn icon_path(&self) -> &AssetPath;

View file

@ -64,7 +64,7 @@ impl<A: Ability> ItemSystem<A> {
let abilities = search_dir_recursively(&ability_directory.full_path(), ".abil")?
.into_iter()
.map(|path| A::create(path))
.map(|path| A::create(engine, path))
.collect::<Result<Vec<A>>>()?;
let (