forked from 2ndbeam/evolution-rs
Property 👍, basic properties and property trait impl
This commit is contained in:
parent
542f0c07d5
commit
a3d619bdd0
1 changed files with 74 additions and 3 deletions
|
|
@ -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!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue