#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Inertia {
pub positive: usize,
pub negative: usize,
pub zero: usize,
}
impl Inertia {
pub fn new(positive: usize, negative: usize, zero: usize) -> Self {
Self {
positive,
negative,
zero,
}
}
pub fn total(&self) -> usize {
self.positive + self.negative + self.zero
}
}
impl std::fmt::Display for Inertia {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "({}, {}, {})", self.positive, self.negative, self.zero)
}
}