use serde::{Deserialize, Serialize};
#[allow(clippy::module_name_repetitions)]
#[derive(Serialize, Deserialize, Debug, Clone, Default, specta::Type)]
#[serde(rename_all = "camelCase", rename = "MechanicalProperties")]
pub struct Properties {
#[serde(rename = "yield")]
yield_stress: i32,
fracture: i32,
elasticity: i32,
}
impl Properties {
#[must_use]
pub fn new() -> Self {
Self::default()
}
#[must_use]
pub const fn is_empty(&self) -> bool {
self.yield_stress == 0 && self.fracture == 0 && self.elasticity == 0
}
pub fn set_yield(&mut self, value: i32) {
self.yield_stress = value;
}
pub fn set_fracture(&mut self, value: i32) {
self.fracture = value;
}
pub fn set_elasticity(&mut self, value: i32) {
self.elasticity = value;
}
}