当前位置: 首页>>代码示例>>Java>>正文


Java QuestDto类代码示例

本文整理汇总了Java中logbook.dto.QuestDto的典型用法代码示例。如果您正苦于以下问题:Java QuestDto类的具体用法?Java QuestDto怎么用?Java QuestDto使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


QuestDto类属于logbook.dto包,在下文中一共展示了QuestDto类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getQuestContent

import logbook.dto.QuestDto; //导入依赖的package包/类
/**
 * 任務一覧の内容
 *
 * @return
 */
public static Stream<QuestBean> getQuestContent() {
    String[] states = { "", "", "遂行中", "達成", "" };
    Function<QuestDto, QuestBean> mapper = e -> {
        QuestBean b = new QuestBean();
        b.setState(states[e.getState()]);
        b.setTitle(e.getTitle());
        b.setDetail(e.getDetail());
        b.setFuel(e.getFuel());
        b.setAmmo(e.getAmmo());
        b.setMetal(e.getMetal());
        b.setBauxite(e.getBauxite());
        return b;
    };
    return GlobalContext.getQuest().values()
            .stream()
            .map(mapper)
            .sorted(Comparator.comparing(QuestBean::getState).reversed());
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:24,代码来源:CreateReportLogic.java

示例2: doQuest

import logbook.dto.QuestDto; //导入依赖的package包/类
/**
 * 任務を更新します
 *
 * @param data
 */
private static void doQuest(Data data) {
    try {
        JsonObject apidata = data.getJsonObject().getJsonObject("api_data");
        if (!apidata.isNull("api_list")) {
            JsonArray apilist = apidata.getJsonArray("api_list");
            for (JsonValue value : apilist) {
                if (value instanceof JsonObject) {
                    JsonObject questobject = (JsonObject) value;
                    // 任務を作成
                    QuestDto quest = new QuestDto();
                    quest.setNo(questobject.getInt("api_no"));
                    quest.setCategory(questobject.getInt("api_category"));
                    quest.setType(questobject.getInt("api_type"));
                    quest.setState(questobject.getInt("api_state"));
                    quest.setTitle(questobject.getString("api_title"));
                    quest.setDetail(questobject.getString("api_detail"));
                    JsonArray material = questobject.getJsonArray("api_get_material");
                    quest.setFuel(material.getJsonNumber(0).toString());
                    quest.setAmmo(material.getJsonNumber(1).toString());
                    quest.setMetal(material.getJsonNumber(2).toString());
                    quest.setBauxite(material.getJsonNumber(3).toString());
                    quest.setBonusFlag(questobject.getInt("api_bonus_flag"));
                    quest.setProgressFlag(questobject.getInt("api_progress_flag"));

                    questMap.put(quest.getNo(), quest);
                }
            }
        }
        addConsole("任務を更新しました");
    } catch (Exception e) {
        LoggerHolder.LOG.warn("任務を更新しますに失敗しました", e);
        LoggerHolder.LOG.warn(data);
    }
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:40,代码来源:GlobalContext.java

示例3: doQuest

import logbook.dto.QuestDto; //导入依赖的package包/类
/**
 * 任務を更新します
 * 
 * @param data
 */
private static void doQuest(Data data) {
    try {
        JsonObject apidata = data.getJsonObject().getJsonObject("api_data");
        if (!apidata.isNull("api_list")) {
            JsonArray apilist = apidata.getJsonArray("api_list");
            for (JsonValue value : apilist) {
                if (value instanceof JsonObject) {
                    JsonObject questobject = (JsonObject) value;
                    // 任務を作成
                    QuestDto quest = new QuestDto();
                    quest.setNo(questobject.getInt("api_no"));
                    quest.setCategory(questobject.getInt("api_category"));
                    quest.setType(questobject.getInt("api_type"));
                    quest.setState(questobject.getInt("api_state"));
                    quest.setTitle(questobject.getString("api_title"));
                    quest.setDetail(questobject.getString("api_detail"));
                    JsonArray material = questobject.getJsonArray("api_get_material");
                    quest.setFuel(material.getJsonNumber(0).toString());
                    quest.setAmmo(material.getJsonNumber(1).toString());
                    quest.setMetal(material.getJsonNumber(2).toString());
                    quest.setBauxite(material.getJsonNumber(3).toString());
                    quest.setBonusFlag(questobject.getInt("api_bonus_flag"));
                    quest.setProgressFlag(questobject.getInt("api_progress_flag"));

                    questMap.put(quest.getNo(), quest);
                }
            }
        }
        addConsole("任務を更新しました");
    } catch (Exception e) {
        LOG.warn("任務を更新しますに失敗しました", e);
        LOG.warn(data);
    }
}
 
开发者ID:kyuntx,项目名称:logbookpn,代码行数:40,代码来源:GlobalContext.java

示例4: getQuestBody

import logbook.dto.QuestDto; //导入依赖的package包/类
/**
 * 任務一覧の内容
 * 
 * @return
 */
public static List<String[]> getQuestBody() {
    List<Object[]> body = new ArrayList<Object[]>();

    for (Entry<Integer, QuestDto> entry : GlobalContext.getQuest().entrySet()) {
        QuestDto quest = entry.getValue();

        String state = "";
        switch (quest.getState()) {
        case 2:
            state = "遂行中";
            break;
        case 3:
            state = "達成";
            break;
        default:
            continue;
        }

        body.add(new Object[] {
                quest.getNo(),
                state,
                quest.getTitle(),
                quest.getDetail(),
                quest.getFuel(),
                quest.getAmmo(),
                quest.getMetal(),
                quest.getBauxite()
        });
    }
    return toListStringArray(body);
}
 
开发者ID:kyuntx,项目名称:logbookpn,代码行数:37,代码来源:CreateReportLogic.java

示例5: doQuest

import logbook.dto.QuestDto; //导入依赖的package包/类
/**
 * 任務を更新します
 * 
 * @param data
 */
private static void doQuest(Data data) {
    try {
        JsonObject apidata = data.getJsonObject().getJsonObject("api_data");
        if (!apidata.isNull("api_list")) {
            JsonArray apilist = apidata.getJsonArray("api_list");
            for (JsonValue value : apilist) {
                if (value instanceof JsonObject) {
                    JsonObject questobject = (JsonObject) value;
                    // 任務を作成
                    QuestDto quest = new QuestDto();
                    quest.setNo(questobject.getInt("api_no"));
                    quest.setCategory(questobject.getInt("api_category"));
                    quest.setType(questobject.getInt("api_type"));
                    quest.setState(questobject.getInt("api_state"));
                    quest.setTitle(questobject.getString("api_title"));
                    quest.setDetail(questobject.getString("api_detail"));
                    JsonArray material = questobject.getJsonArray("api_get_material");
                    quest.setFuel(material.getJsonNumber(0).toString());
                    quest.setAmmo(material.getJsonNumber(1).toString());
                    quest.setMetal(material.getJsonNumber(2).toString());
                    quest.setBauxite(material.getJsonNumber(3).toString());
                    quest.setBonusFlag(questobject.getInt("api_bonus_flag"));
                    quest.setProgressFlag(questobject.getInt("api_progress_flag"));

                    questMap.put(quest.getNo(), quest);
                }
            }
        }
        addConsole("Quest info updated");
    } catch (Exception e) {
        LOG.warn("Failed to update quest data", e);
        LOG.warn(data);
    }
}
 
开发者ID:silfumus,项目名称:logbook-EN,代码行数:40,代码来源:GlobalContext.java

示例6: getQuestBody

import logbook.dto.QuestDto; //导入依赖的package包/类
/**
 * 任務一覧の内容
 * 
 * @return
 */
public static List<String[]> getQuestBody() {
    List<Object[]> body = new ArrayList<Object[]>();

    for (Entry<Integer, QuestDto> entry : GlobalContext.getQuest().entrySet()) {
        QuestDto quest = entry.getValue();

        String state = "";
        switch (quest.getState()) {
        case 1:
            state = "Inactive";
            break;
        case 2:
            state = "Active";
            break;
        case 3:
            state = "Done";
            break;
        default:
            continue;
        }

        body.add(new Object[] {
                quest.getNo(),
                state,
                quest.getTitle(),
                quest.getDetail(),
                quest.getFuel(),
                quest.getAmmo(),
                quest.getMetal(),
                quest.getBauxite()
        });
    }
    return toListStringArray(body);
}
 
开发者ID:silfumus,项目名称:logbook-EN,代码行数:40,代码来源:CreateReportLogic.java

示例7: getQuest

import logbook.dto.QuestDto; //导入依赖的package包/类
/**
 * 任務を取得します
 * @return 任務
 */
public static Map<Integer, QuestDto> getQuest() {
    return questMap;
}
 
开发者ID:sanaehirotaka,项目名称:logbook,代码行数:8,代码来源:GlobalContext.java


注:本文中的logbook.dto.QuestDto类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。