示例#1
0
        public static void CalcRex(string pair)
        {
            List <string> instrument = new List <string>();

            instrument.Add(pair);
            var point = GetAccountInstrumentsAsync(AccountID, new AccountInstrumentsParameters {
                instruments = instrument
            }).Result.Last().pipLocation;

            Rex = CalcMA(TVB, PeriodLength);
            Rex = Rex.Select(i => i / Math.Pow(10, point - 1)).ToArray();
        }
        static void Main(string[] args)
        {
            ProcRunTime();
            DomainInfo();
            Threading();
            ThreadAim();
            Timer();

            for (int i = 0; i < 10; i++)
            {
                Rex rex = new Rex(i);
            }

            Console.ReadKey();
        }
示例#3
0
        protected override List <TplResult> InnerProcess(List <TplResult> input)
        {
            var  dict      = new ConcurrentDictionary <long, TplResult>();
            long resultNum = 0;

            Parallel.ForEach(input, result =>
            {
                if (result.HasField(TargetField))
                {
                    var match = Rex.Match(result.StringValueOf(TargetField));

                    if (match.Success)
                    {
                        var groupNames = Rex.GetNamedCaptureGroupNames();
                        foreach (var key in groupNames)
                        {
                            result.AddOrUpdateField(key, match.Groups[key].Value);
                        }

                        if (!PassThru)
                        {
                            dict.TryAdd(resultNum, result);
                            resultNum++;
                        }
                    }
                }
            });

            //Return
            if (!PassThru)
            {
                var output = new List <TplResult>(dict.Count);

                for (long i = 0; i < dict.Count; i++)
                {
                    output.Add(dict[i]);
                }

                return(output);
            }
            else
            {
                return(input);
            }
        }
示例#4
0
    private void StartGame(Scene scene, LoadSceneMode mode)
    {
        this.GameOver  = false;
        Time.timeScale = 1;

        this.ScoreHandler  = GameObject.FindObjectOfType <ScoreHandler>();
        this.RestartButton = GameObject.Find("RestartButton");
        this.Rex           = GameObject.Find("Rex");
        this.GameOverText  = GameObject.Find("GameOver");
        this.RexManager    = this.Rex.GetComponent <Rex>();

        if (this.GameOverText != null)
        {
            this.GameOverText.SetActive(false);
        }

        if (this.RestartButton != null)
        {
            this.RestartButton.SetActive(false);
        }
    }
示例#5
0
		private void Write(Rex rex) => Write((byte)((rex & ~Rex.Reserved_Mask) | Rex.Reserved_Value));
示例#6
0
			public void SetRex(Rex rex)
			{
				BaseRegExtension = (rex & Rex.BaseRegExtension) != 0;
				IndexRegExtension = (rex & Rex.IndexRegExtension) != 0;
			}