상속: OsirisSerializable
예제 #1
0
파일: Common.cs 프로젝트: xenogenesi/lslib
        public AdapterRef ReadAdapterRef()
        {
            var adapterRef = new AdapterRef();

            adapterRef.Read(this);
            return(adapterRef);
        }
예제 #2
0
파일: Rule.cs 프로젝트: slimlime/lslib
        public override void MakeScript(TextWriter writer, Story story, Tuple tuple)
        {
            switch (GetRuleType(story))
            {
            case RuleType.Proc: writer.WriteLine("PROC"); break;

            case RuleType.Query: writer.WriteLine("QRY"); break;

            case RuleType.Rule: writer.WriteLine("IF"); break;
            }

            var initialTuple = MakeInitialTuple();

            if (AdapterRef.IsValid)
            {
                var adapter = AdapterRef.Resolve();
                initialTuple = adapter.Adapt(initialTuple);
            }

            ParentRef.Resolve().MakeScript(writer, story, initialTuple);
            writer.WriteLine("THEN");
            foreach (var call in Calls)
            {
                call.MakeScript(writer, story, initialTuple);
                writer.WriteLine(";");
            }
        }
예제 #3
0
파일: Rel.cs 프로젝트: xenogenesi/lslib
        public override void Read(OsiReader reader)
        {
            base.Read(reader);
            ParentRef  = reader.ReadNodeRef();
            AdapterRef = reader.ReadAdapterRef();

            RelDatabaseRef = reader.ReadDatabaseRef();
            RelDatabase    = new NodeEntryItem();
            RelDatabase.Read(reader);
            RelDatabaseFlag = reader.ReadByte();
        }
예제 #4
0
파일: Rel.cs 프로젝트: Norbyte/lslib
        public override void Read(OsiReader reader)
        {
            base.Read(reader);
            ParentRef = reader.ReadNodeRef();
            AdapterRef = reader.ReadAdapterRef();

            RelDatabaseRef = reader.ReadDatabaseRef();
            RelDatabase = new NodeEntryItem();
            RelDatabase.Read(reader);
            RelDatabaseFlag = reader.ReadByte();
        }
예제 #5
0
파일: Join.cs 프로젝트: xenogenesi/lslib
        public override void Read(OsiReader reader)
        {
            base.Read(reader);
            LeftParentRef  = reader.ReadNodeRef();
            RightParentRef = reader.ReadNodeRef();
            Adapter1Ref    = reader.ReadAdapterRef();
            Adapter2Ref    = reader.ReadAdapterRef();

            Database1Ref = reader.ReadDatabaseRef();
            Database1    = new NodeEntryItem();
            Database1.Read(reader);
            Database1Flag = reader.ReadByte();

            Database2Ref = reader.ReadDatabaseRef();
            Database2    = new NodeEntryItem();
            Database2.Read(reader);
            Database2Flag = reader.ReadByte();
        }
예제 #6
0
파일: Join.cs 프로젝트: Norbyte/lslib
        public override void Read(OsiReader reader)
        {
            base.Read(reader);
            LeftParentRef = reader.ReadNodeRef();
            RightParentRef = reader.ReadNodeRef();
            Adapter1Ref = reader.ReadAdapterRef();
            Adapter2Ref = reader.ReadAdapterRef();

            Database1Ref = reader.ReadDatabaseRef();
            Database1 = new NodeEntryItem();
            Database1.Read(reader);
            Database1Flag = reader.ReadByte();

            Database2Ref = reader.ReadDatabaseRef();
            Database2 = new NodeEntryItem();
            Database2.Read(reader);
            Database2Flag = reader.ReadByte();
        }
예제 #7
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();
        }