MakeScript() публичный Метод

public MakeScript ( TextWriter writer, Story story, Tuple tuple, bool printTypes = false ) : void
writer System.IO.TextWriter
story Story
tuple Tuple
printTypes bool
Результат void
Пример #1
0
        public override void MakeScript(TextWriter writer, Story story, Tuple tuple)
        {
            var adaptedTuple = story.Adapters[AdapterRef.AdapterIndex].Adapt(tuple);

            story.Nodes[ParentRef.NodeIndex].MakeScript(writer, story, adaptedTuple);
            writer.WriteLine("AND");

            if (Value1Index != -1)
            {
                adaptedTuple.Logical[Value1Index].MakeScript(writer, story, tuple);
            }
            else
            {
                Value1.MakeScript(writer, story, tuple);
            }

            switch (RelOp)
            {
            case RelOpType.Less: writer.Write(" < "); break;

            case RelOpType.LessOrEqual: writer.Write(" <= "); break;

            case RelOpType.Greater: writer.Write(" > "); break;

            case RelOpType.GreaterOrEqual: writer.Write(" >= "); break;

            case RelOpType.Equal: writer.Write(" == "); break;

            case RelOpType.NotEqual: writer.Write(" != "); break;
            }

            if (Value2Index != -1)
            {
                adaptedTuple.Logical[Value2Index].MakeScript(writer, story, tuple);
            }
            else
            {
                Value2.MakeScript(writer, story, tuple);
            }
            writer.WriteLine();
        }
Пример #2
0
        public override void MakeScript(TextWriter writer, Story story, Tuple tuple)
        {
            var adaptedTuple = AdapterRef.Resolve().Adapt(tuple);

            ParentRef.Resolve().MakeScript(writer, story, adaptedTuple);
            writer.WriteLine("AND");

            if (LeftValueIndex != -1)
            {
                adaptedTuple.Logical[LeftValueIndex].MakeScript(writer, story, tuple);
            }
            else
            {
                LeftValue.MakeScript(writer, story, tuple);
            }

            switch (RelOp)
            {
            case RelOpType.Less: writer.Write(" < "); break;

            case RelOpType.LessOrEqual: writer.Write(" <= "); break;

            case RelOpType.Greater: writer.Write(" > "); break;

            case RelOpType.GreaterOrEqual: writer.Write(" >= "); break;

            case RelOpType.Equal: writer.Write(" == "); break;

            case RelOpType.NotEqual: writer.Write(" != "); break;
            }

            if (RightValueIndex != -1)
            {
                adaptedTuple.Logical[RightValueIndex].MakeScript(writer, story, tuple);
            }
            else
            {
                RightValue.MakeScript(writer, story, tuple);
            }
            writer.WriteLine();
        }