Esempio n. 1
0
 public void AddOrUpdate <T>(int type, T value)
 {
     if (!ExportedStats.ContainsKey(type) || !ExportedStats[type].Equals(value))
     {
         StatsToExport.Add(type, value);
     }
 }
Esempio n. 2
0
        public Stat[] GetStats()
        {
            var val = StatsToExport.Select(_ =>
            {
                if (!ExportedStats.ContainsKey(_.Key))
                {
                    ExportedStats.Add(_.Key, _.Value);
                }
                else
                {
                    ExportedStats[_.Key] = _.Value;
                }

                return(new Stat()
                {
                    StatType = _.Key,
                    Data = _.Value
                });
            }).ToArray();

            StatsToExport.Clear();

            return(val);
        }