Пример #1
0
        internal RuleBook FindOrCreateRuleBook <RT>(String Name, int ArgCount)
        {
            var r = FindRuleBook(Name);

            if (r == null)
            {
                if (typeof(RT) == typeof(PerformResult))
                {
                    r = new PerformRuleBook(this)
                    {
                        Name = Name, ArgumentCount = ArgCount
                    }
                }
                ;
                else if (typeof(RT) == typeof(CheckResult))
                {
                    r = new CheckRuleBook(this)
                    {
                        Name = Name, ArgumentCount = ArgCount
                    }
                }
                ;
                else
                {
                    r = new ValueRuleBook <RT>(this)
                    {
                        Name = Name, ArgumentCount = ArgCount
                    }
                };

                RuleBooks.Add(r);
            }

            return(r);
        }
Пример #2
0
 public CommandEntry()
 {
     ManPages.Pages.Add(this);
     GeneratedManual = new StringBuilder();
     ProceduralRules = new PerformRuleBook(Core.GlobalRules.Rules)
     {
         ArgumentCount = 2
                         /*ArgumentTypes = new List<Type>(new Type[] { typeof(PossibleMatch), typeof(Actor) }),*/
     };
 }