Esempio n. 1
0
        public string SetConditions()
        {
            string ErrorMsg = null;

            if (JobEnabled.Checked)
            {
                JobList.Clear();
                for (int i = 0; i <= (JobListBox.Items.Count - 1); i++)
                {
                    if (JobListBox.GetItemChecked(i))
                    {
                        JobList.Add(JobListBox.Items[i].ToString());
                    }
                }
                if (JobList.Count != 0)
                {
                    if (OneJobOnly.Checked)
                    {
                        job = Convert.ToString((string)JobList[random.Next(0, JobList.Count)]);
                    }
                    if (JobList.Count < 4 && JobExistFalse.Checked)
                    {
                        Error     = true;
                        ErrorMsg += ("職業を被らせない設定は選択している職業数が4つ以上である必要があります。\n");
                    }
                }
                else
                {
                    Error     = true;
                    ErrorMsg += ("職業が選択されていません。\n");
                }
            }
            if (TypeEnabled.Checked)
            {
                TypeList.Clear();
                for (int i = 0; i <= (TypeListBox.Items.Count - 1); i++)
                {
                    if (TypeListBox.GetItemChecked(i))
                    {
                        TypeList.Add(TypeListBox.Items[i].ToString());
                    }
                }
                if (TypeList.Count != 0)
                {
                    if (OneTypeOnly.Checked)
                    {
                        type = Convert.ToString((string)TypeList[random.Next(0, TypeList.Count)]);
                    }
                    if (TypeList.Count < 4 && TypeExistFalse.Checked)
                    {
                        Error     = true;
                        ErrorMsg += ("タイプを被らせない設定は選択しているタイプ数が4つ以上である必要があります。\n");
                    }
                }
                else
                {
                    Error     = true;
                    ErrorMsg += ("タイプが選択されていません。\n");
                }
            }
            if (RarityEnabled.Checked)
            {
                RareList.Clear();
                if (UseRarity.Checked)
                {
                    for (int i = 0; i <= (RarityListBox.Items.Count - 1); i++)
                    {
                        if (RarityListBox.GetItemChecked(i))
                        {
                            RareList.Add(RarityListBox.Items[i].ToString());
                        }
                    }
                    TRResult.Text = "";
                    if (RareList.Count == 0)
                    {
                        Error     = true;
                        ErrorMsg += ("レアリティが選択されていません。\n");
                    }
                }
                if (UseTotalRarity.Checked)
                {
                    TRResult.Text = "レアリティ合計値:" + random.Next((int)TRMinimum.Value, (int)TRMax.Value);
                }
            }
            if (RareTypeEnabled.Checked)
            {
                RareTypeList.Clear();
                for (int i = 0; i <= (RareTypeListBox.Items.Count - 1); i++)
                {
                    if (RareTypeListBox.GetItemChecked(i))
                    {
                        RareTypeList.Add(RareTypeListBox.Items[i].ToString());
                    }
                }
                if (RareTypeList.Count != 0)
                {
                    if (OneRareTypeOnly.Checked)
                    {
                        raretype = Convert.ToString((string)RareTypeList[random.Next(0, RareTypeList.Count)]);
                    }
                }
                else
                {
                    Error     = true;
                    ErrorMsg += ("種類が選択されていません。\n");
                }
            }
            if (AttributeEnabled.Checked)
            {
                AttributeList.Clear();
                for (int i = 0; i <= (AttributeListBox.Items.Count - 1); i++)
                {
                    if (AttributeListBox.GetItemChecked(i))
                    {
                        AttributeList.Add(AttributeListBox.Items[i].ToString());
                    }
                }
                if (AttributeList.Count != 0)
                {
                    attribute = Convert.ToString((string)AttributeList[random.Next(0, AttributeList.Count)]);
                }
                else
                {
                    Error     = true;
                    ErrorMsg += ("属性が選択されていません。\n");
                }
            }
            if (!JobEnabled.Checked && !TypeEnabled.Checked && !RarityEnabled.Checked && !RareTypeEnabled.Checked && !AttributeEnabled.Checked)
            {
                Error     = true;
                ErrorMsg += ("有効になっている条件がありません。");
            }
            return(ErrorMsg);
        }
Esempio n. 2
0
 private void HandleRarePokemon(SnipePokemonViewModel model)
 {
     RareList.RemoveAll(x => ShouldRemove(x, model));
     RareList.Insert(0, model);
     Refresh("RareList", RareList);
 }