1
0
Fork 0

Property 👍, basic properties and property trait impl

This commit is contained in:
Rendo 2025-02-15 20:24:25 +05:00
commit a3d619bdd0

View file

@ -1,4 +1,75 @@
pub trait Properties { // Базовый трейт для свойства животного
fn check_condition<T>(conditions: T) -> bool; // Интересно, будет ли участвовать в моддинге
fn trigger<T>(data: T); pub trait Property {
fn check_condition<T>(self : &Self,conditions: T) -> bool;
fn trigger<T>(self : &Self, data: T);
}
pub enum BaseProperties
{
Swimmings,
Running,
Mimicry,
HBW,
Grazing,
Poisonous,
TailLoss,
Communication,
Hibernation,
Scavenger,
Symbiosis,
Piracy,
Cooperation,
Burrowing,
Camouflage,
SharpVision,
Parasite
}
impl Property for BaseProperties {
fn check_condition<T>(self : &Self, conditions: T) -> bool {
match self
{
BaseProperties::Swimmings => todo!(),
BaseProperties::Running => todo!(),
BaseProperties::Mimicry => todo!(),
BaseProperties::HBW => todo!(),
BaseProperties::Grazing => todo!(),
BaseProperties::Poisonous => todo!(),
BaseProperties::TailLoss => todo!(),
BaseProperties::Communication => todo!(),
BaseProperties::Hibernation => todo!(),
BaseProperties::Scavenger => todo!(),
BaseProperties::Symbiosis => todo!(),
BaseProperties::Piracy => todo!(),
BaseProperties::Cooperation => todo!(),
BaseProperties::Burrowing => todo!(),
BaseProperties::Camouflage => todo!(),
BaseProperties::SharpVision => todo!(),
BaseProperties::Parasite => todo!(),
}
}
fn trigger<T>(self : &Self, data: T) {
match self
{
BaseProperties::Swimmings => todo!(),
BaseProperties::Running => todo!(),
BaseProperties::Mimicry => todo!(),
BaseProperties::HBW => todo!(),
BaseProperties::Grazing => todo!(),
BaseProperties::Poisonous => todo!(),
BaseProperties::TailLoss => todo!(),
BaseProperties::Communication => todo!(),
BaseProperties::Hibernation => todo!(),
BaseProperties::Scavenger => todo!(),
BaseProperties::Symbiosis => todo!(),
BaseProperties::Piracy => todo!(),
BaseProperties::Cooperation => todo!(),
BaseProperties::Burrowing => todo!(),
BaseProperties::Camouflage => todo!(),
BaseProperties::SharpVision => todo!(),
BaseProperties::Parasite => todo!(),
}
}
} }