public OP_CompositionEngine() { OPData_Memory sqtest = new OPData_Memory("pso2_op_base.db"); opdataContainer = new OPDataContainer(sqtest); RecipeData_Memory res = new RecipeData_Memory("pso2_op_base.db"); recipeDataContainer = new RecipeDataContainer(res); }
public static List <OP_Recipe2> add_NULL_Recipe(int slot_count, List <OP_Recipe2> op) { if (slot_count == 0) { return(op); } int d = slot_count - op.Count(); List <OP_Recipe2> op_fix = op.Select(x => x).ToList(); for (int i = 0; i < d; i++) { var OP_none = RecipeDataContainer.GetOP_Recipes(OPDataContainer.GetOP_Stct("none")); op_fix.Add(OP_none[0]); } return(op_fix); }
/// <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); }