Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
 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();
 }