Goal.java 文件源码

java
阅读 28 收藏 0 点赞 0 评论 0

项目:QuestManager 作者:
public void loadState(GoalState state) throws InvalidConfigurationException {

    if (!state.getName().equals(name)) {
        QuestManagerPlugin.logger.warning("Loading state information"
                + "from a file that has a mismatched goal name!");
    }

    //WARNING:
    //this is assuming that the lists are maintianed in the right order.
    //it should work this way, but this is a point of error!
    ListIterator<RequirementState> states = state.getRequirementStates().listIterator();
    for (Requirement req : requirements) {
        req.sync();
        try {
            if (req instanceof StatekeepingRequirement) {
                ((StatekeepingRequirement) req).loadState(states.next());
            }
        } catch (NoSuchElementException e) {
            QuestManagerPlugin.logger.warning("Error when loading state for quest" 
                    + this.getQuest().getName() + "; Not enough requirement states!");
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号