public OP_stct_flag(op_stct2 n)
 {
     jp_name = n.jp_name;
     op_name = n.op_name;
     series  = n.series;
     flag    = false;
 }
        private void Add_OP_Button_Click(object sender, RoutedEventArgs e)
        {
            var selectOP = OP_ListBox.SelectedItem;

            if (selectOP is op_stct2)
            {
                op_stct2 op = (op_stct2)selectOP;
                ContextData.targetOPList.Add(op);

                var isDuped = OP_CompositionEngine.checkOP(ContextData.targetOPList.ToList());
                if (isDuped.Count != 0)
                {
                    foreach (var op_d in isDuped)
                    {
                        ContextData.targetOPList.Remove(op_d);
                    }
                    ContextData.targetOPList.Add(op);
                }

                if (ContextData.targetOPList.Count == 8)
                {
                    Add_OP_Button.IsEnabled = false;
                }

                Remove_OP_Button.IsEnabled = true;
                StartButton.IsEnabled      = true;
            }

            TargetOP_ListBox.ItemsSource = ContextData.targetOPList;
        }
示例#3
0
        public override void load(SQLiteDataReader data)
        {
            op_stct2        out_name      = OPDataContainer.GetOP_Stct(data.GetValue(1) as string);
            List <op_stct2> out_marteials = new List <op_stct2>();

            for (int i = 2; i <= 7; i++)
            {
                var s = data.GetValue(i);

                if (s is System.DBNull == false)
                {
                    op_stct2 mat_temp = OPDataContainer.GetOP_Stct(s as string);
                    out_marteials.Add(mat_temp);
                }
            }

            var per_str     = data.GetValue(8) as long?;
            int out_percent = 0;

            if (per_str != null)
            {
                out_percent = (int)per_str;
            }

            OP_Recipe2 recp = new OP_Recipe2()
            {
                name      = out_name,
                materials = out_marteials,
                percent   = out_percent
            };

            op_recipes.Add(recp);
        }
示例#4
0
        public override void load(SQLiteDataReader data)
        {
            var op_name      = data.GetValue(0);
            var Display_name = data.GetValue(1);
            var Series       = data.GetValue(2);

            op_stct2 newst = new op_stct2()
            {
                jp_name = Display_name as string,
                op_name = op_name as string,
                series  = Series as string
            };

            op_lists.Add(newst);
        }
        private void Remove_OP_Button_Click(object sender, RoutedEventArgs e)
        {
            var selectOP = TargetOP_ListBox.SelectedItem;

            if (selectOP is op_stct2)
            {
                op_stct2 op = (op_stct2)selectOP;
                ContextData.targetOPList.Remove(op);

                if (ContextData.targetOPList.Count == 0)
                {
                    Remove_OP_Button.IsEnabled = false;
                    StartButton.IsEnabled      = false;
                }
                Add_OP_Button.IsEnabled = true;
            }

            TargetOP_ListBox.ItemsSource = ContextData.targetOPList;
        }
        /// <summary>
        /// opに指定された素材と、確率を返す。
        /// percent_plusで成功確率を上げる
        /// </summary>
        /// <param name="op">素材</param>
        /// <param name="percent_Plus">確率上昇率</param>
        /// <returns>素材</returns>
        static public (int, List <op_stct2>) GetMaterials(op_stct2 op, int percent_Plus = 0)
        {
            var comArr = RecipeDataContainer.GetOP_Recipes(op);

            comArr = comArr.OrderBy(x => x.percent).ToList();

            if (comArr.Count == 0)
            {
                Console.WriteLine("Recepi Not Found:{0}", op.jp_name);
                return(GetMaterials(OPDataContainer.GetOP_Stct("none")));
            }

            OP_Recipe2 opc = comArr[0];

            foreach (OP_Recipe2 o in comArr)
            {
                opc = o;
                int p = o.percent + percent_Plus;
                if (p >= 100)
                {
                    break;
                }
            }

            List <op_stct2> op_s = new List <op_stct2>();

            foreach (op_stct2 name in opc.materials)
            {
                op_s.Add(name);
            }

            int output_p = opc.percent + percent_Plus;

            if (output_p > 100)
            {
                output_p = 100;
            }
            return(output_p, op_s);
        }
            public int                 percent;   //成功確率

            public OP_Recipe_flag(OP_Recipe2 o)
            {
                name      = o.name;
                percent   = o.percent;
                materials = o.materials.Select(x => new OP_stct_flag(x)).ToList();
            }
示例#8
0
 static public List <OP_Recipe2> GetOP_Recipes(op_stct2 op)
 {
     return(recipe_data.GetOP_Recipe(op));
 }
示例#9
0
        public List <OP_Recipe2> GetOP_Recipe(op_stct2 op)
        {
            List <OP_Recipe2> op_r = op_recipes.Where(x => (x.name.op_name == op.op_name)).ToList();

            return(op_r);
        }