virtual protected float ChildUnify(Unifiable with, XmlNode childNode)
        {
            bool   wasTrue;
            float  partCallCanUnify;
            string useLess;

            if (TextWith(childNode, with, out wasTrue, out useLess))
            {
                partCallCanUnify = wasTrue ? AND_TRUE : AND_FALSE;
            }
            else
            {
                if (childNode == templateNode)
                {
                    throw new Exception("This is inside iteself!");
                }
                AIMLTagHandler part = GetChildTagHandler(childNode);
                partCallCanUnify = part.CallCanUnify(with);
            }
            return(partCallCanUnify);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Provides an instantiation of the class represented by this tag-handler
 /// </summary>
 /// <param name="Assemblies">All the assemblies the bot knows about</param>
 /// <returns>The instantiated class</returns>
 public AIMLTagHandler Instantiate(Dictionary <string, Assembly> Assemblies, User user, SubQuery query,
                                   Request request, Result result, XmlNode node, AltBot bot)
 {
     lock (Assemblies)
         if (Assemblies.ContainsKey(this.AssemblyName))
         {
             if (type != null)
             {
                 if (info == null)
                 {
                     info = type.GetConstructor(CONSTRUCTOR_TYPES);
                 }
                 if (info != null)
                 {
                     return((AIMLTagHandler)info.Invoke(new object[] { bot, user, query, request, result, node }));
                 }
             }
             Assembly       tagDLL       = Assemblies[this.AssemblyName];
             AIMLTagHandler newCustomTag = (AIMLTagHandler)tagDLL.CreateInstance(ClassName);
             if (newCustomTag == null)
             {
                 return(null);
             }
             newCustomTag.query        = query;
             newCustomTag.request      = request;
             newCustomTag.result       = result;
             newCustomTag.templateNode = node;
             newCustomTag.bot          = bot;
             newCustomTag.user         = user;
             return(newCustomTag);
         }
         else
         {
             return(null);
         }
 }
Exemplo n.º 3
0
 public bool IsSourceRequest(AIMLTagHandler node, out string src)
 {
     src = null;
     return(false);
 }