Esempio n. 1
0
        public override LispOperator <TBb> CreateOperator(
            TBb blackboard,
            LispParser.Node node,
            LispParser.ICompiler <TBb> compiler)
        {
            LispParser.IdentifierNode identifierNode = node as LispParser.IdentifierNode;
            if (identifierNode == null)
            {
                return(null);
            }

            Func <bool> func = blackboard.GetBoolFunction(identifierNode.Value);

            if (func == null)
            {
                return(null);
            }

            return(new BlackboardBoolFunction <TBb>(identifierNode.Value, func));
        }
Esempio n. 2
0
        public override LispOperator <TBb> CreateOperator(TBb blackboard, LispParser.Node node, LispParser.ICompiler <TBb> compiler)
        {
            LispParser.IdentifierNode identifierNode = node as LispParser.IdentifierNode;

            return(identifierNode != null && identifierNode.Value == "False" ? new FalseConstant <TBb>() : null);
        }