예제 #1
0
        private void MakeUp(List <string> list, IMakeUp ip)
        {
            file  = list[0].Split(',');
            Count = ip.Turn;
            count = new long[file.Length - 1];
            int i;

            do
            {
                arr = list[list.Count - Count].Split(',');
                Count--;

                for (i = 0; i < count.Length; i++)
                {
                    count[i] += long.Parse(arr[i + 1]);
                }
            }while (Count > 1);

            for (i = 0; i < count.Length; i++)
            {
                ip.DescendingSort[file[i + 1]] = count[i];
            }

            i = 0;

            foreach (KeyValuePair <string, long> kv in ip.DescendingSort.OrderByDescending(o => o.Value))
            {
                if (i > 13)
                {
                    break;
                }

                string.Concat(ip.FindByName, i++).FindByName <Button>(this).Text = string.Concat(kv.Key.Replace('^', '.'), " ₩", kv.Value.ToString("N0"));
            }
        }
예제 #2
0
파일: Recall.cs 프로젝트: w1r2p1/GoblinBat
        private IMakeUp MakeUp(List <string> list, IMakeUp ip)
        {
            string[] transitory, temp = list[0].Split(',');
            Count = ip.Turn;
            long[] count = new long[temp.Length - 1];
            int    i;

            do
            {
                transitory = list[list.Count - Count].Split(',');
                Count--;

                for (i = 0; i < count.Length; i++)
                {
                    count[i] += long.Parse(transitory[i + 1]);
                }
            }while (Count > 1);

            for (i = 0; i < count.Length; i++)
            {
                ip.DescendingSort[temp[i + 1]] = count[i];
            }

            return(ip);
        }
예제 #3
0
파일: Recall.cs 프로젝트: w1r2p1/GoblinBat
        private IMakeUp MakeUp(List <Logs> list, IMakeUp ip, int recent, int length)
        {
            if (ip.FindByName.Equals("cumulative"))
            {
                ip.Turn = length;
            }

            foreach (var makeUp in list.FindAll(o => o.Date.Equals(recent)))
            {
                ip.DescendingSort[makeUp.Strategy] = makeUp.Cumulative + makeUp.Unrealized - list.FindAll(o => o.Strategy.Equals(makeUp.Strategy)).OrderByDescending(o => o.Date).ElementAt(ip.Turn).Cumulative;
            }

            return(ip);
        }
예제 #4
0
        private double MakeUp(List <string> list, IMakeUp ip)
        {
            file  = list[0].Split(',');
            Count = ip.Turn;
            count = new long[file.Length - 1];
            int    i, check = 0;
            double best;

            do
            {
                arr = list[list.Count - Count].Split(',');
                Count--;

                for (i = 0; i < count.Length; i++)
                {
                    count[i] += long.Parse(arr[i + 1]);
                }
            }while (Count > 1);

            for (i = 0; i < count.Length; i++)
            {
                ip.DescendingSort[file[i + 1]] = count[i];
            }

            i = 0;

            foreach (KeyValuePair <string, long> kv in ip.DescendingSort.OrderByDescending(o => o.Value))
            {
                if (i < 14)
                {
                    if (i < 1)
                    {
                        Keys[ip.Turn] = kv.Key;
                    }

                    string.Concat(ip.FindByName, i++).FindByName <Button>(this).Text = string.Concat(kv.Key.Replace('^', '.'), " Day", (kv.Value / Assets / (ip.FindByName.Equals("cumulative") ? list.Count - 2 : ip.Turn - 1)).ToString("P3"));
                }
                check += kv.Value > 0 ? 1 : -1;
            }
            best = check / (double)ip.DescendingSort.Count;
            SendColor?.Invoke(this, new Statistics(check > 0 ? Color.Maroon : check < 0 ? Color.Navy : Color.Ivory, ip.Turn, best));

            return(best);
        }