Пример #1
0
        /// <summary>
        /// Update game engine statistics
        /// </summary>
        /// <param name="s"></param>
        private void ProcessStat(EngineStat s)
        {
            if (EngineStats.ContainsKey(s.Id))
            {
                EngineStats[s.Id].Sum   += s.Sum;
                EngineStats[s.Id].Count += s.Count;

                Logger.LogDebug("updated stat {ChallengeId} {Sum} {Count} {Average}", EngineStats[s.Id].Id, EngineStats[s.Id].Sum, EngineStats[s.Id].Count, EngineStats[s.Id].Average);
            }
            else
            {
                EngineStats.Add(s.Id, s);
            }
        }
Пример #2
0
 /// <summary>
 /// Return wait time in seconds for challenge initialization
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public int ChallengeWaitSeconds(string id)
 {
     return(EngineStats.ContainsKey(id)
         ? EngineStats[id].Average
         : 0);
 }