void CalcRefineOption(ref ItemDB db, ItemDB item_db) { foreach (KeyValuePair <int, Dictionary <ITEM_OPTION_TYPE, Dictionary <string, double> > > keyValue in item_db.Option_Refine) { if (Refine >= keyValue.Key) { if (db == null) { db = new ItemDB(); } ItemDB.AddOption(db.Option, keyValue.Value); } } foreach (AbilityPerStatus ability in item_db.Option_IF_TYPE) { if (db == null) { db = new ItemDB(); } db += ability.GetRefineOption(Refine); } if (Refine > 0) { if (db == null) { db = new ItemDB(); } db += RefineTable.GetRefineOption(REFINE_OPTION_TYPE.COMMON, Refine); } }