static public void AddCustomRecalculate(ModRecalculateCustom customRecalculate) { m_RecalulateList.Add(customRecalculate); ReorderRecalculateList(); }
static public void AddOrder(this Dictionary <int, ModRecalculateCustom> dic, int pos, ModRecalculateCustom obj, bool warn = false) { try { if (dic.ContainsKey(pos)) { AddOrder(dic, pos + 1, obj, true); } dic.Add(pos, obj); if (warn) { Debug.Log("Character Stat API warning : The loading priority for " + obj.ToString() + " priority : " + obj.RecalculatePriority + " is allready used, priotity : " + pos + " given"); } } catch (OverflowException) { throw new Exception("Error, the Minimum priority is allready used by : " + dic[short.MaxValue].ToString() + ", only one recalculate can be at the Minimum priority"); } }