using System; using System.Collections.Generic; public partial class PlayerPropertyConfig : IConfigPostProcess { private static Dictionary> m_PropCfgs = new Dictionary>(); public void OnConfigParseCompleted() { List list = null; m_PropCfgs.TryGetValue(type, out list); if (list != null) { list.Add(this); } else { list = new List(); list.Add(this); m_PropCfgs.Add(type, list); } } public static List GetPropByType(int type) { List list = null; m_PropCfgs.TryGetValue(type, out list); return list; } public static string GetPropertyDescription(int propertyId, int value) { var config = Get(propertyId); if (config == null) { return string.Empty; } if (config.ISPercentage == 0) { return value.ToString(); } else if (config.ISPercentage == 1) { return (float)Math.Round(value / 100f, 1) + "%"; } else if (config.ISPercentage == 2) { return ((float)Math.Round(value / 100f, 1)).ToString(); } return string.Empty; } }