use super::{CellSelection, SourceContribution};
#[derive(Debug, Clone, PartialEq)]
pub struct SemiImplicitSource {
name: String,
field: String,
selection: CellSelection,
contribution: SourceContribution,
}
impl SemiImplicitSource {
#[must_use]
pub fn new(
name: impl Into<String>,
field: impl Into<String>,
selection: CellSelection,
explicit: f64,
implicit: f64,
) -> Self {
Self {
name: name.into(),
field: field.into(),
selection,
contribution: SourceContribution { explicit, implicit },
}
}
#[must_use]
pub fn name(&self) -> &str {
&self.name
}
#[must_use]
pub fn field_name(&self) -> &str {
&self.field
}
#[must_use]
pub fn selection(&self) -> &CellSelection {
&self.selection
}
#[must_use]
pub fn contribution(&self) -> SourceContribution {
self.contribution
}
}