private static void Save(Type type) { using (ServiceBussiness sb = new ServiceBussiness()) { foreach (FieldInfo fieldInfo in type.GetFields()) { if (fieldInfo.IsStatic) { object[] customAttributes = fieldInfo.GetCustomAttributes(typeof(ConfigPropertyAttribute), false); if (customAttributes.Length != 0) { GameProperties.SaveProperty((ConfigPropertyAttribute)customAttributes[0], sb, fieldInfo.GetValue((object)null)); } } } } }
private static void Load(Type type) { using (ServiceBussiness sb = new ServiceBussiness()) { foreach (FieldInfo f in type.GetFields()) { if (!f.IsStatic) { continue; } object[] attribs = f.GetCustomAttributes(typeof(ConfigPropertyAttribute), false); if (attribs.Length == 0) { continue; } ConfigPropertyAttribute attrib = (ConfigPropertyAttribute)attribs[0]; f.SetValue(null, GameProperties.LoadProperty(attrib, sb)); } } }
private static void Save(Type type) { using (ServiceBussiness serviceBussiness = new ServiceBussiness()) { FieldInfo[] fields = type.GetFields(); for (int i = 0; i < fields.Length; i++) { FieldInfo fieldInfo = fields[i]; if (fieldInfo.IsStatic) { object[] customAttributes = fieldInfo.GetCustomAttributes(typeof(ConfigPropertyAttribute), false); if (customAttributes.Length != 0) { ConfigPropertyAttribute attrib = (ConfigPropertyAttribute)customAttributes[0]; GameProperties.SaveProperty(attrib, serviceBussiness, fieldInfo.GetValue(null)); } } } } }
public static void Save() { GameProperties.log.Info("Saving game properties into db!"); GameProperties.Save(typeof(GameProperties)); }
public static int HoleLevelUpExp(int lv) { return(GameProperties.getProp(GameProperties.HoleLevelUpExpList)[lv]); }
public static int VIPStrengthenExp(int vipLv) { return(GameProperties.getProp(GameProperties.VIPStrengthenEx)[vipLv]); }
public static int ConsortiaStrengExp(int Lv) { return(GameProperties.getProp(GameProperties.ConsortiaStrengthenEx)[Lv]); }
public static List <int> RuneExp() { return(GameProperties.getProp(GameProperties.RuneLevelUpExp)); }
public static List <int> VIPExp() { return(GameProperties.getProp(GameProperties.VIPExpForEachLv)); }
public static void Refresh() { GameProperties.log.Info("Refreshing game properties!"); GameProperties.Load(typeof(GameProperties)); }