use crate::core::{Id, Ordinal, Tactic};
#[derive(Debug)]
pub struct Burial {
burials: Vec<Id>,
}
impl Burial {
#[must_use]
pub const fn new(burials: Vec<Id>) -> Self {
Self { burials }
}
}
impl Tactic<Ordinal> for Burial {
fn apply(&self, ballot: Ordinal) -> Ordinal {
let mut ranking: Vec<Id> = (*ballot).clone();
ranking.retain(|c| !self.burials.contains(c));
ranking.append(&mut self.burials.clone());
Ordinal(ranking)
}
}