Exemple #1
0
        protected override IEnumerator <DeserializeRequest> Deserialize(EasyReader input)
        {
            _query = new Query();

            _query.Name      = input.ReadString();
            _query.Subtype   = input.ReadString();
            _query.Exclusive = input.ReadBoolean();

            // Read filters
            int filterCount = input.ReadInt32();

            for (int i = 0; i < filterCount; i++)
            {
                var filter = Filter.GetFilterInstance(input.ReadUInt16());
                if (filter == null)
                {
                    continue;
                }
                filter.Deserialize(input);
                _query.AddFilter(filter);
            }

            // Carrier
            if (input.ReadBoolean())
            {
                _query.Carrier = new Carrier();
                _query.Carrier.Deserialize(input);
            }

            var complementRequest = new DeserializeRequest();

            yield return(complementRequest);

            _query.Complement = complementRequest.Result;
        }
Exemple #2
0
        protected override IEnumerator <DeserializeRequest> Deserialize(EasyReader input)
        {
            input.ReadString(out Name);
            var bodyRequest = new DeserializeRequest();

            yield return(bodyRequest);

            Body = bodyRequest.Result;
        }
Exemple #3
0
        protected override IEnumerator <DeserializeRequest> Deserialize(EasyReader input)
        {
            int count = input.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                var request = new DeserializeRequest();
                yield return(request);

                Actions.Add(request.Result);
            }
        }
Exemple #4
0
        protected override IEnumerator <DeserializeRequest> Deserialize(EasyReader input)
        {
            input.ReadInt32(out _argc);
            string funcName = input.ReadString();

            _funcInfo = RantFunctionRegistry.GetFunction(funcName, _argc);
            if (_args == null)
            {
                _args = new List <RST>(_argc);
            }
            for (int i = 0; i < _argc; i++)
            {
                var request = new DeserializeRequest();
                yield return(request);

                _args.Add(request.Result);
            }
        }
Exemple #5
0
        protected override IEnumerator <DeserializeRequest> Deserialize(EasyReader input)
        {
            input.ReadInt32(out _count);
            input.ReadBoolean(out _weighted);
            if (_weighted)
            {
                // Read constant weights
                if (input.ReadBoolean())
                {
                    input.ReadDouble(out _constantWeightSum);
                    _weights = new double[_count];
                    for (int i = 0; i < _count; i++)
                    {
                        input.ReadDouble(out _weights[i]);
                    }
                }

                // Read dynamic weights
                int numDW = input.ReadInt32();
                if (numDW > 0)
                {
                    _dynamicWeights = new List <_ <int, RST> >(numDW);
                    for (int i = 0; i < numDW; i++)
                    {
                        int index   = input.ReadInt32();
                        var request = new DeserializeRequest();
                        yield return(request);

                        _dynamicWeights.Add(new _ <int, RST>(index, request.Result));
                    }
                }
            }

            // Read elements
            _elements = new List <RST>(_count);
            for (int i = 0; i < _count; i++)
            {
                var request = new DeserializeRequest();
                yield return(request);

                _elements.Add(request.Result);
            }
        }
Exemple #6
0
        protected override IEnumerator <DeserializeRequest> Deserialize(EasyReader input)
        {
            var options = RegexOptions.Compiled | RegexOptions.ExplicitCapture;

            if (input.ReadBoolean())
            {
                options |= RegexOptions.IgnoreCase;
            }
            _regex = new Regex(input.ReadString(), options);
            var request = new DeserializeRequest();

            yield return(request);

            _rstSource = request.Result;
            request    = new DeserializeRequest();
            yield return(request);

            _rstMatchEval = request.Result;
        }
        protected override IEnumerator <DeserializeRequest> Deserialize(EasyReader input)
        {
            var iterMain = base.Deserialize(input);

            while (iterMain.MoveNext())
            {
                yield return(iterMain.Current);
            }
            input.ReadBoolean(out _inModule);
            input.ReadString(out _moduleFunctionName);
            int argc = input.ReadInt32();

            if (Arguments == null)
            {
                Arguments = new List <RST>(argc);
            }
            for (int i = 0; i < argc; i++)
            {
                var request = new DeserializeRequest();
                yield return(request);

                Arguments.Add(request.Result);
            }
        }