diff --git a/src/animal.rs b/src/animal.rs index 2403913..c7993c7 100644 --- a/src/animal.rs +++ b/src/animal.rs @@ -1,6 +1,9 @@ use bevy::prelude::*; +use crate::properties::Property; + #[derive(Component)] pub struct Animal { //pub properties: Vec<тут крч пропертис> -} + pub properties: Vec> +} \ No newline at end of file diff --git a/src/properties/mod.rs b/src/properties/mod.rs index a326671..db9601d 100644 --- a/src/properties/mod.rs +++ b/src/properties/mod.rs @@ -1,8 +1,9 @@ + // Базовый трейт для свойства животного // Интересно, будет ли участвовать в моддинге -pub trait Property { - fn check_condition(self : &Self,conditions: T) -> bool; - fn trigger(self : &Self, data: T); +pub trait Property: Sync + Send { + fn check_condition(self : &Self) -> bool; + fn trigger(self : &Self); } pub enum BaseProperties @@ -27,7 +28,7 @@ pub enum BaseProperties } impl Property for BaseProperties { - fn check_condition(self : &Self, conditions: T) -> bool { + fn check_condition(self : &Self) -> bool { match self { BaseProperties::Swimmings => todo!(), @@ -50,7 +51,7 @@ impl Property for BaseProperties { } } - fn trigger(self : &Self, data: T) { + fn trigger(self : &Self) { match self { BaseProperties::Swimmings => todo!(),