Esempio n. 1
0
        private void LegendCalBtn_Click(object sender, EventArgs e)
        {
            string a = Properties.Resources.commonList;
            List <Commonamount> amountlist = JsonConvert.DeserializeObject <List <Commonamount> >(a);
            List <string>       charaterdata;
            Double totalcount = 0;

            listView1.Items.Clear();
            ListViewItem item;

            try
            {
                int gc = int.Parse(countTB.Text);
                if (gc > 12)
                {
                    MessageBox.Show("잘못된 값을 입력하셨습니다."); return;
                }
                else if (gc == 1)
                {
                    MessageBox.Show("최소 한 개 이상만 검색이 가능합니다."); return;
                }
                charaterdata = s.GetCharacters(gc);
                foreach (Commonamount amount in amountlist)
                {
                    foreach (string name in charaterdata)
                    {
                        if (amount.characterName == name)
                        {
                            item = new ListViewItem(amount.characterName);
                            item.SubItems.Add(amount.Luppi.ToString());
                            item.SubItems.Add(amount.Zoro.ToString());
                            item.SubItems.Add(amount.Nami.ToString());
                            item.SubItems.Add(amount.Usopp.ToString());
                            item.SubItems.Add(amount.Sanji.ToString());
                            item.SubItems.Add(amount.Chopper.ToString());
                            item.SubItems.Add(amount.Buggy.ToString());
                            item.SubItems.Add(amount.musketeer.ToString());
                            item.SubItems.Add(amount.Swordsman.ToString());
                            item.SubItems.Add(amount.TotalCommonamount.ToString());

                            listView1.Items.Add(item);
                            item        = null;
                            totalcount += amount.TotalCommonamount;
                        }
                        else
                        {
                            continue;
                        }
                    }
                }
                Double result = Math.Round(totalcount / 39.7, 1);
                s.Send(string.Format("「ORD_TOOL」조합 계산 결과 : 약 {0}전설", result));
            }
            catch (Exception ex)
            {
                MessageBox.Show("잘못된 숫자를 입력하셨습니다." + ex);
            }
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            int count = 1;

            data = new List <Dice>();
            a    = textBox1.Text.Split(',');
            arr  = rp.randomteam(a.Length);
            string smsg = null;
            //LstEventList = LstEventList.OrderBy(sel => sel.EventDate).ToList();
            Dice dicedata = new Dice();

            for (int i = 0; i < a.Length; i++)
            {
                dicedata.index = arr[i];
                dicedata.name  = a[i];
                data.Add(dicedata);
            }

            data = data.OrderBy(x => x.index).ToList();


            for (int i = 0; i < a.Length; i++)
            {
                if (i % 3 == 0)
                {
                    smsg += string.Format("{0}팀 - ", count++);
                }

                smsg += data[i].name + ":" + data[i].index + " ";
                if ((i + 1) % 3 == 0)
                {
                    if (i != a.Length)
                    {
                        smsg += "|n";
                    }
                }
            }
            //1글자씩 했을때 최대 12팀
            //2글자씩 했을때
            s.Send($"\x1「ORD_TOOL」팀 랜덤 다이스 결과|n" + smsg);
            a.Initialize();
            arr.Initialize();
            data.Clear();
        }
Esempio n. 3
0
 private void button1_Click(object sender, EventArgs e)
 {
     s.Send(sendtxt);
 }