Пример #1
0
 public String connectFixTags(GameData g) {
   StringBuilder buf = new StringBuilder();
   for (Tag t : g.getFixTags()) {
     buf.insert(0, t.getName() + ",");
   }
   if (buf.length() > 0) {
     buf.deleteCharAt(buf.length() - 1);
   }
   return buf.toString();
 }
Пример #2
0
  public List<EveryDayGameRankingVo> rankingGame(int maxNum) {

    List<EveryDayGameRanking> asList =
        Datastore.query(EveryDayGameRanking.class)
            .sort(EveryDayGameRankingMeta.get().deltaPoint.desc)
            .asList();
    int size = asList.size();
    if (size < maxNum) maxNum = size;
    List<EveryDayGameRankingVo> g = new ArrayList<EveryDayGameRankingVo>();
    for (EveryDayGameRanking edg : asList) {
      GameData gameData = Datastore.get(GameData.class, edg.getKey().getParent());
      contentCut(gameData);
      if (g.size() < maxNum) {

        EveryDayGameRankingVo setEdgvo = null;
        Set<Tag> fixTags = gameData.getFixTags();
        int deltaPoit = edg.getDeltaPoint();
        Boolean check = false;
        if (fixTags.size() != 0) {
          for (Tag tag : fixTags) {
            if (tag.getName().equals("チュートリアル")) {
              check = true;
            }
          }
          if (!check) {
            setEdgvo = setEdgvo(gameData, deltaPoit);
            g.add(setEdgvo);
          }
        } else {
          setEdgvo = setEdgvo(gameData, deltaPoit);
          g.add(setEdgvo);
        }
      } else break;
    }
    return g;
  }