コード例 #1
0
        protected override void GenerateConstructor(Node node, StringWriter stream, string indent, string className)
        {
            base.GenerateConstructor(node, stream, indent, className);

            DecoratorIterator iterator = node as DecoratorIterator;

            if (iterator == null)
            {
                return;
            }

            if (iterator.Opl != null || iterator.Opr != null)
            {
                if (iterator.Opl != null)
                {
                    stream.WriteLine("{0}\t\t\tthis.m_opl = AgentMeta.ParseProperty(\"{1}\");", indent, iterator.Opl.GetExportValue());
                    stream.WriteLine("{0}\t\t\tDebug.Check(this.m_opl != null);", indent);
                }

                if (iterator.Opr != null)
                {
                    stream.WriteLine("{0}\t\t\tthis.m_opr = AgentMeta.ParseProperty(\"{1}\");", indent, iterator.Opr.GetExportValue());
                    stream.WriteLine("{0}\t\t\tDebug.Check(this.m_opr != null);", indent);
                }
            }
        }
コード例 #2
0
        protected override void GenerateConstructor(Node node, StreamWriter stream, string indent, string className)
        {
            base.GenerateConstructor(node, stream, indent, className);

            DecoratorIterator iterator = node as DecoratorIterator;

            if (iterator == null)
            {
                return;
            }

            if (iterator.Opl != null || iterator.Opr != null)
            {
                stream.WriteLine("{0}\t\t\tbehaviac::string typeName;", indent);

                if (iterator.Opl != null)
                {
                    stream.WriteLine("{0}\t\t\tthis->m_opl = Condition::LoadLeft(\"{1}\", typeName);", indent, iterator.Opl.GetExportValue());
                    stream.WriteLine("{0}\t\t\tBEHAVIAC_ASSERT(this->m_opl != NULL);", indent);
                }

                if (iterator.Opr != null)
                {
                    stream.WriteLine("{0}\t\t\tthis->m_opr = Condition::LoadRight(\"{1}\", typeName);", indent, iterator.Opr.GetExportValue());
                    stream.WriteLine("{0}\t\t\tBEHAVIAC_ASSERT(this->m_opr != NULL);", indent);
                }
            }
        }
コード例 #3
0
        protected override void GenerateConstructor(Node node, StreamWriter stream, string indent, string className)
        {
            base.GenerateConstructor(node, stream, indent, className);

            DecoratorIterator iterator = node as DecoratorIterator;

            if (iterator == null)
            {
                return;
            }

            if (iterator.Opl != null || iterator.Opr != null)
            {
                if (iterator.Opl != null)
                {
                    stream.WriteLine("{0}\t\t\tthis.m_opl = Condition.LoadLeft(\"{1}\");", indent, iterator.Opl.GetExportValue());
                    stream.WriteLine("{0}\t\t\tDebug.Check(this.m_opl != null);", indent);
                }

                stream.WriteLine("{0}\t\t\tstring typeName = null;", indent);

                if (iterator.Opr != null)
                {
                    stream.WriteLine("{0}\t\t\tthis.m_opr = Condition.LoadRight(\"{1}\", ref typeName);", indent, iterator.Opr.GetExportValue());
                    stream.WriteLine("{0}\t\t\tDebug.Check(this.m_opr != null);", indent);
                }
            }
        }
コード例 #4
0
        protected override bool ShouldGenerateClass(Node node)
        {
            DecoratorIterator iterator = node as DecoratorIterator;

            return(iterator != null);
        }