Improve create method
This commit is contained in:
parent
4702c5431b
commit
4d2abde5ca
2 changed files with 2 additions and 2 deletions
|
@ -20,7 +20,7 @@ use super::{
|
||||||
};
|
};
|
||||||
|
|
||||||
pub trait Ability: Send + Sync + Clone + Default {
|
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 name(&self) -> &str;
|
||||||
fn icon_path(&self) -> &AssetPath;
|
fn icon_path(&self) -> &AssetPath;
|
||||||
|
|
|
@ -64,7 +64,7 @@ impl<A: Ability> ItemSystem<A> {
|
||||||
|
|
||||||
let abilities = search_dir_recursively(&ability_directory.full_path(), ".abil")?
|
let abilities = search_dir_recursively(&ability_directory.full_path(), ".abil")?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|path| A::create(path))
|
.map(|path| A::create(engine, path))
|
||||||
.collect::<Result<Vec<A>>>()?;
|
.collect::<Result<Vec<A>>>()?;
|
||||||
|
|
||||||
let (
|
let (
|
||||||
|
|
Loading…
Reference in a new issue