Exemplo n.º 1
0
  public SystemHeroLevel getSystemHeroLevel(int color, int exp) {
    SystemHeroLevel systemHeroLevel = null;
    List<SystemHeroLevel> levelList = super.getValue(color);
    for (SystemHeroLevel level : levelList) {
      if (systemHeroLevel == null) {
        systemHeroLevel = level;
      } else {
        if (level.getExp() <= exp && level.getLevel() > systemHeroLevel.getLevel()) {
          systemHeroLevel = level;
        }
      }
    }

    return systemHeroLevel;
  }
Exemplo n.º 2
0
  public SystemHeroLevel getSystemHeroLevelByLevel(int color, int level) {
    List<SystemHeroLevel> levelList = super.getValue(color);
    for (SystemHeroLevel heroLevel : levelList) {
      if (heroLevel.getLevel() == level) return heroLevel;
    }

    return null;
  }