public bool AddRule(char aVariable, float aWeight, string aRuleRightSide) { LSystemRule rule; if (!mRules.ContainsKey(aVariable)) { rule = new LSystemRule(aVariable, aWeight, aRuleRightSide); mRules.Add(aVariable, rule); return(true); } rule = mRules[aVariable]; return(rule.AddRightSide(aWeight, aRuleRightSide)); }
public bool RemoveRule(LSystemRule.RuleRightSide aRightSide) { if (aRightSide == null) { return(false); } LSystemRule rule = mRules[aRightSide.left]; if (rule == null) { return(false); } return(rule.RemoveRightSide(aRightSide)); }
private void FillRules() { ruleList.BeginUpdate(); ruleList.Items.Clear(); foreach (KeyValuePair <char, LSystemRule> ruleRec in mLSystem.rules) { LSystemRule rule = ruleRec.Value; foreach (LSystemRule.RuleRightSide rside in rule.mRightSides) { ruleList.Items.Add(rside); } } ruleList.EndUpdate(); mLSystem.ToString(); }