Example #1
0
 /// <summary>
 /// 获取ScoreCache的单例
 /// </summary>
 /// <param name="id"></param>
 /// <returns></returns>
 public static ScoreCache GetScore()
 {
     if (scoreCache == null)
     {
         lock (_lockHelper)
         {
             scoreCache = new ScoreCache();
         }
     }
     return(scoreCache);
 }
Example #2
0
        public bool ScoreCacheAddOne()
        {
            ScoreCache scoreCache = ExtendMethord.GetScore();

            if (scoreCache.scoreMap.ContainsKey(GuidName))
            {
                scoreCache.scoreMap[GuidName]     = scoreCache.scoreMap[GuidName] + 1;
                scoreCache.scoreMap["ModifyFlag"] = 1;
            }
            else
            {
                scoreCache.scoreMap[GuidName]     = 1;
                scoreCache.scoreMap["ModifyFlag"] = 1;
            }
            return(true);
        }