Exemplo n.º 1
0
  public boolean verify(UserDomain userDomain, StoryVerify storyVerify) {
    if (userDomain == null || storyVerify == null) {
      return false;
    }

    Collection<Long> propsIds =
        propsManager.getUserPropsIdList(userDomain.getId(), BackpackType.DEFAULT_BACKPACK);
    int totleNumber = 0;
    for (long userPropsId : propsIds) {
      UserProps userProps = propsManager.getUserProps(userPropsId);
      if (userProps == null) {
        continue;
      }

      if (userProps.getBaseId() == storyVerify.getParam1()) {
        totleNumber += userProps.getCount();
      }
    }

    if (totleNumber < storyVerify.getParam2()) {
      return false;
    }

    return true;
  }
Exemplo n.º 2
0
 /**
  * 获取基础道具
  *
  * @param itemId 用户道具ID
  * @return {@link PropsConfig} 查询用户道具类型
  */
 protected PropsConfig getBaseItem(int itemId) {
   return itemManager.getPropsConfig(itemId);
 }