pub struct Configuration {
pub lists: Vec<ChoiceList>,
pub extras: Vec<String>,
}Fields§
§lists: Vec<ChoiceList>In the game schema’s order, which is the order the page asks them in.
extras: Vec<String>Checked packages that take no choice: pacenotes and any other category.
Implementations§
Source§impl Configuration
impl Configuration
Sourcepub fn from_tree(
tree: &Tree,
keep: &[String],
choice_categories: &[&'static str],
) -> Configuration
pub fn from_tree( tree: &Tree, keep: &[String], choice_categories: &[&'static str], ) -> Configuration
The lists for the checked leaves of tree. A key in keep that is
still offered stays picked across a trip back to scene 4, failing that
what is installed, and a list with a single option comes preselected.
choice_categories comes from the game’s compiled-in schema, since
which questions a game asks is its own.
pub fn is_complete(&self) -> bool
Sourcepub fn missing(&self) -> Vec<&'static str>
pub fn missing(&self) -> Vec<&'static str>
The categories still waiting for a pick, as the warning names them.
pub fn select(&mut self, list: usize, option: Option<usize>)
Sourcepub fn selected_key(&self, category: &str) -> Option<&str>
pub fn selected_key(&self, category: &str) -> Option<&str>
The pick for one category, by name, so a reordered schema cannot misdirect it.
Sourcepub fn selected_keys(&self) -> Vec<String>
pub fn selected_keys(&self) -> Vec<String>
In list order, skipping empty lists.
Sourcepub fn picks_by_category(&self) -> BTreeMap<String, String>
pub fn picks_by_category(&self) -> BTreeMap<String, String>
Category to picked key, for the game’s configuration step to take what it understands.
Sourcepub fn install_keys(&self) -> Vec<String>
pub fn install_keys(&self) -> Vec<String>
The picks, then the extras, each key once.
Trait Implementations§
Source§impl Clone for Configuration
impl Clone for Configuration
Source§fn clone(&self) -> Configuration
fn clone(&self) -> Configuration
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more