Exemple #1
0
        protected override void GenerateMethod(Node node, StringWriter stream, string indent)
        {
            base.GenerateMethod(node, stream, indent);

            DecoratorCount decoratorCount = node as DecoratorCount;

            if (decoratorCount == null)
            {
                return;
            }

            if (decoratorCount.Count != null)
            {
                stream.WriteLine("{0}\t\tvirtual int GetCount(Agent* pAgent) const", indent);
                stream.WriteLine("{0}\t\t{{", indent);
                stream.WriteLine("{0}\t\t\tBEHAVIAC_UNUSED_VAR(pAgent);", indent);

                string retStr = VariableCppExporter.GenerateCode(node, decoratorCount.Count, false, stream, indent + "\t\t\t", string.Empty, string.Empty, string.Empty);

                stream.WriteLine("{0}\t\t\treturn {1};", indent, retStr);
                stream.WriteLine("{0}\t\t}}", indent);
            }
        }
Exemple #2
0
        protected override bool ShouldGenerateClass(Node node)
        {
            DecoratorCount decoratorCount = node as DecoratorCount;

            return(decoratorCount != null);
        }