Beispiel #1
0
 /**
  * 获取该等级的经验上限
  *
  * @param heroLevel
  * @return
  */
 public static int getExpLimit(int heroLevel) {
   StaticHeroLevel levelInfo = STORE.get(heroLevel);
   if (levelInfo == null) {
     logger.error("没有等级[" + heroLevel + "]对应的数据");
     return 1;
   }
   return levelInfo.getExpLimit();
 }
Beispiel #2
0
 /**
  * 获取该等级的经验池上限
  *
  * @param heroLevel
  * @return
  */
 public static int getPoolLimit(int heroLevel) {
   StaticHeroLevel levelInfo = STORE.get(heroLevel);
   if (levelInfo == null) {
     logger.error("没有等级[" + heroLevel + "]对应的数据");
     return Integer.MAX_VALUE;
   }
   return levelInfo.getPoolLimit();
 }
Beispiel #3
0
 private HeroLevelCache(CacheMapper cacheMapper) {
   List<StaticHeroLevel> list = cacheMapper.getStaticHeroLevel();
   STORE = new HashMap<Integer, StaticHeroLevel>();
   for (StaticHeroLevel e : list) {
     if (STORE.containsKey(e.getHeroLevel())) {
       logger.error("duplicate key");
     }
     STORE.put(e.getHeroLevel(), e);
   }
   logger.info("[done]");
 }