[meta] Map global TransformGroup to local TransformGroup indices;
This commit is contained in:
@@ -148,6 +148,14 @@ impl SettingGroup {
|
||||
}
|
||||
panic!("Should have found bool setting by name.");
|
||||
}
|
||||
|
||||
pub fn predicate_by_name(&self, name: &'static str) -> SettingPredicateNumber {
|
||||
self.predicates
|
||||
.iter()
|
||||
.find(|pred| pred.name == name)
|
||||
.unwrap_or_else(|| panic!("unknown predicate {}", name))
|
||||
.number
|
||||
}
|
||||
}
|
||||
|
||||
/// This is the basic information needed to track the specific parts of a setting when building
|
||||
@@ -209,10 +217,12 @@ struct ProtoPredicate {
|
||||
node: PredicateNode,
|
||||
}
|
||||
|
||||
pub type SettingPredicateNumber = u8;
|
||||
|
||||
pub struct Predicate {
|
||||
pub name: &'static str,
|
||||
node: PredicateNode,
|
||||
pub number: u8,
|
||||
pub number: SettingPredicateNumber,
|
||||
}
|
||||
|
||||
impl Predicate {
|
||||
|
||||
Reference in New Issue
Block a user