protected override void GenerateMethod(Node node, StreamWriter stream, string indent)
        {
            base.GenerateMethod(node, stream, indent);

            WaitFramesState waitFramesState = node as WaitFramesState;

            if (waitFramesState == null)
            {
                return;
            }

            if (waitFramesState.Frames != null)
            {
                stream.WriteLine("{0}\t\tprotected override int GetFrames(Agent pAgent)", indent);
                stream.WriteLine("{0}\t\t{{", indent);

                string retStr = RightValueCsExporter.GenerateCode(waitFramesState.Frames, stream, indent + "\t\t\t", string.Empty, string.Empty, "Frames");

                if (!waitFramesState.Frames.IsPublic && (waitFramesState.Frames.IsMethod || waitFramesState.Frames.Var != null && waitFramesState.Frames.Var.IsProperty))
                {
                    retStr = string.Format("Convert.ToInt32({0})", retStr);
                }

                stream.WriteLine("{0}\t\t\treturn {1};", indent, retStr);
                stream.WriteLine("{0}\t\t}}", indent);
            }
        }
        protected override void GenerateMember(Node node, StreamWriter stream, string indent)
        {
            base.GenerateMember(node, stream, indent);

            WaitFramesState waitFramesState = node as WaitFramesState;

            if (waitFramesState == null)
            {
                return;
            }

            if (waitFramesState.Frames != null)
            {
                RightValueCppExporter.GenerateClassMember(waitFramesState.Frames, stream, indent, "Frames");
            }
        }
        protected override void GenerateConstructor(Node node, StreamWriter stream, string indent, string className)
        {
            base.GenerateConstructor(node, stream, indent, className);

            WaitFramesState waitFramesState = node as WaitFramesState;

            if (waitFramesState == null)
            {
                return;
            }

            if (waitFramesState.Frames != null)
            {
                RightValueCsExporter.GenerateClassConstructor(waitFramesState.Frames, stream, indent, "Frames");
            }
        }
        protected override void GenerateMethod(Node node, StreamWriter stream, string indent)
        {
            base.GenerateMethod(node, stream, indent);

            WaitFramesState waitFramesState = node as WaitFramesState;

            if (waitFramesState == null)
            {
                return;
            }

            if (waitFramesState.Frames != null)
            {
                stream.WriteLine("{0}\t\tprotected override int GetFrames(Agent pAgent)", indent);
                stream.WriteLine("{0}\t\t{{", indent);

                string retStr = RightValueCsExporter.GenerateCode(waitFramesState.Frames, 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);
            }
        }
        protected override void GenerateMethod(Node node, StreamWriter stream, string indent)
        {
            base.GenerateMethod(node, stream, indent);

            WaitFramesState waitFramesState = node as WaitFramesState;

            if (waitFramesState == null)
            {
                return;
            }

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

                string retStr = RightValueCppExporter.GenerateCode(waitFramesState.Frames, stream, indent + "\t\t\t", string.Empty, string.Empty, "Frames");

                stream.WriteLine("{0}\t\t\treturn {1};", indent, retStr);
                stream.WriteLine("{0}\t\t}}", indent);
            }
        }
Example #6
0
        protected override bool ShouldGenerateClass(Node node)
        {
            WaitFramesState waitFramesState = node as WaitFramesState;

            return(waitFramesState != null);
        }