Exemplo n.º 1
0
  /**
   * 当前玩的关卡是否已经激活
   *
   * @return
   */
  private static boolean isPass(String levelValues, int level) {
    boolean flag = false;
    String levelString = String.valueOf(level);
    String[] levelValuesSet = StringUtil.split(levelValues, ",", true);

    for (int i = 0; i < levelValuesSet.length; i++) {
      if (levelString.equals(levelValuesSet[i])) {
        flag = true;
      }
    }
    return flag;
  }
Exemplo n.º 2
0
 /**
  * 获取关卡数
  *
  * @param levelValues
  * @return
  */
 private static int getLevelCount(String levelValues) {
   int levelCount;
   String[] levelValuesSet = StringUtil.split(levelValues, ",", true);
   levelCount = levelValuesSet.length;
   return levelCount;
 }