예제 #1
0
        /// <summary>
        /// Provides a list of strings that act as a readout of the statistic name and it's value.
        /// </summary>
        /// <param name="module"></param>
        /// <returns></returns>
        public static Dictionary <string, string> GetModuleReadout(this IStatModule module)
        {
            var propProps  = module.GetType().GetProperties();
            var stringList = new Dictionary <string, string>();

            foreach (var prop in propProps)
            {
                stringList.Add(prop.Name.AddSpacesToSentence(false), prop.GetValue(module).ToString());
            }
            return(stringList);
        }
예제 #2
0
 public void SendPage(IEnumerable <OverwatchDataTable> tableCollection)
 {
     foreach (var item in tableCollection)
     {
         var prop = GetType().GetProperty(item.Name.Replace(" ", ""));
         if (prop != null && typeof(IStatModule).IsAssignableFrom(prop.PropertyType))
         {
             IStatModule statModule = (IStatModule)Activator.CreateInstance(prop.PropertyType);
             statModule.SendTable(item);
             prop.SetValue(this, statModule);
         }
     }
 }