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


Java FreeColXMLReader.shouldClearContainers方法代码示例

本文整理汇总了Java中net.sf.freecol.common.io.FreeColXMLReader.shouldClearContainers方法的典型用法代码示例。如果您正苦于以下问题:Java FreeColXMLReader.shouldClearContainers方法的具体用法?Java FreeColXMLReader.shouldClearContainers怎么用?Java FreeColXMLReader.shouldClearContainers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sf.freecol.common.io.FreeColXMLReader的用法示例。


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

示例1: readChildren

import net.sf.freecol.common.io.FreeColXMLReader; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void readChildren(FreeColXMLReader xr) throws XMLStreamException {
    // Clear containers.
    if (xr.shouldClearContainers()) {
        skills = null;
        regions = null;
    }

    final Specification spec = getSpecification();
    IndianNationType parent = xr.getType(spec, EXTENDS_TAG,
                                         IndianNationType.class, this);
    if (parent != this) {
        if (parent.skills != null && !parent.skills.isEmpty()) {
            if (skills == null) skills = new ArrayList<>();
            skills.addAll(parent.skills);
        }

        if (parent.regions != null && !parent.regions.isEmpty()) {
            if (regions == null) regions = new ArrayList<>();
            regions.addAll(parent.regions);
        }
    }

    super.readChildren(xr);
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:29,代码来源:IndianNationType.java

示例2: readChildren

import net.sf.freecol.common.io.FreeColXMLReader; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void readChildren(FreeColXMLReader xr) throws XMLStreamException {
    // Clear containers.
    if (xr.shouldClearContainers()) {
        settlementTypes = null;
    }

    final Specification spec = getSpecification();
    NationType parent = xr.getType(spec, EXTENDS_TAG,
                                   NationType.class, this);
    if (parent != this) {
        if (parent.settlementTypes != null) {
            addSettlementTypes(parent.settlementTypes);
        }

        addFeatures(parent);
        if (parent.isAbstractType()) {
            getFeatureContainer().replaceSource(parent, this);
        }
    }

    super.readChildren(xr);
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:27,代码来源:NationType.java

示例3: readChildren

import net.sf.freecol.common.io.FreeColXMLReader; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void readChildren(FreeColXMLReader xr) throws XMLStreamException {
    // Clear containers.
    if (xr.shouldClearContainers()) {
        effects = null;
    }

    final Specification spec = getSpecification();
    Disaster parent = xr.getType(spec, EXTENDS_TAG, Disaster.class, this);

    if (parent != this && !parent.getEffects().isEmpty()) {
        if (effects == null) effects = new ArrayList<>();
        for (RandomChoice<Effect> choice : parent.getEffects()) {
            Effect effect = new Effect(choice.getObject());
            effect.getFeatureContainer().replaceSource(parent, this);
            addEffect(effect);
        }
    }

    super.readChildren(xr);
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:25,代码来源:Disaster.java

示例4: readChildren

import net.sf.freecol.common.io.FreeColXMLReader; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void readChildren(FreeColXMLReader xr) throws XMLStreamException {
    // Clear containers.
    if (xr.shouldClearContainers()) {
        startingUnitMap.clear();
    }

    final Specification spec = getSpecification();
    EuropeanNationType parent = xr.getType(spec, EXTENDS_TAG,
                                           EuropeanNationType.class, this);
    if (parent != this) {
        forEachMapEntry(parent.startingUnitMap, e ->
            startingUnitMap.put(e.getKey(), new HashMap<>(e.getValue())));
    }

    super.readChildren(xr);
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:21,代码来源:EuropeanNationType.java

示例5: readChildren

import net.sf.freecol.common.io.FreeColXMLReader; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void readChildren(FreeColXMLReader xr) throws XMLStreamException {
    if (xr.shouldClearContainers()) {
        requiredAbilities = null;
        requiredGoods = null;
        limits = null;
    }

    super.readChildren(xr);
}
 
开发者ID:wintertime,项目名称:FreeCol,代码行数:14,代码来源:BuildableType.java

示例6: readChildren

import net.sf.freecol.common.io.FreeColXMLReader; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void readChildren(FreeColXMLReader xr) throws XMLStreamException {
    // Clear containers.
    if (xr.shouldClearContainers()) {
        roleChanges = null;
    }

    super.readChildren(xr);
}
 
开发者ID:wintertime,项目名称:FreeCol,代码行数:13,代码来源:Role.java

示例7: readChildren

import net.sf.freecol.common.io.FreeColXMLReader; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void readChildren(FreeColXMLReader xr) throws XMLStreamException {
    final Specification spec = getSpecification();

    // Clear containers.
    if (xr.shouldClearContainers()) {
        this.production = null;
    }

    while (xr.moreTags()) {
        final String tag = xr.getLocalName();

        if (PRODUCTION_TAG.equals(tag)) {
            GoodsType type = xr.getType(spec, GOODS_TYPE_TAG,
                                        GoodsType.class, (GoodsType)null);

            int amount = xr.getAttribute(VALUE_TAG, 0);

            this.production = new AbstractGoods(type, amount);

            xr.closeTag(PRODUCTION_TAG);

        } else {
            throw new XMLStreamException("Bogus TileTypeChange tag: "
                + tag);
        }
    }
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:32,代码来源:TileTypeChange.java

示例8: readChildren

import net.sf.freecol.common.io.FreeColXMLReader; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void readChildren(FreeColXMLReader xr) throws XMLStreamException {
    // Clear containers.
    if (xr.shouldClearContainers()) {
        this.disasters = null;
        this.resourceTypes = null;
        this.productionTypes.clear();
    }

    super.readChildren(xr);
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:15,代码来源:TileType.java

示例9: readChildren

import net.sf.freecol.common.io.FreeColXMLReader; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void readChildren(FreeColXMLReader xr) throws XMLStreamException {
    final Specification spec = getSpecification();

    // Clear containers.
    if (xr.shouldClearContainers()) {
        consumption = null;
    }
    defaultRole = spec.getDefaultRole();

    UnitType parent = xr.getType(spec, EXTENDS_TAG, UnitType.class, this);
    if (parent != this) {
        defaultRole = parent.defaultRole;

        if (parent.consumption != null) {
            if (consumption == null) consumption = new TypeCountMap<>();
            consumption.putAll(parent.consumption);
        }

        addFeatures(parent);
        if (parent.isAbstractType()) {
            getFeatureContainer().replaceSource(parent, this);
        }
    }

    super.readChildren(xr);
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:31,代码来源:UnitType.java

示例10: readChildren

import net.sf.freecol.common.io.FreeColXMLReader; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void readChildren(FreeColXMLReader xr) throws XMLStreamException {
    // Clear containers.
    if (xr.shouldClearContainers()) {
        allowedWorkers = null;
        tileTypeChanges = null;
        disasters = null;
    }

    super.readChildren(xr);
}
 
开发者ID:wintertime,项目名称:FreeCol,代码行数:15,代码来源:TileImprovementType.java

示例11: readChildren

import net.sf.freecol.common.io.FreeColXMLReader; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void readChildren(FreeColXMLReader xr) throws XMLStreamException {
    // Clear containers.
    if (xr.shouldClearContainers()) {
        this.plunderTypes = null;
        this.gifts = null;
    }

    super.readChildren(xr);
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:14,代码来源:SettlementType.java

示例12: readChildren

import net.sf.freecol.common.io.FreeColXMLReader; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void readChildren(FreeColXMLReader xr) throws XMLStreamException {
    // Clear containers.
    if (xr.shouldClearContainers()) {
        events = null;
        units = null;
    }
    
    super.readChildren(xr);
}
 
开发者ID:wintertime,项目名称:FreeCol,代码行数:14,代码来源:FoundingFather.java

示例13: readChildren

import net.sf.freecol.common.io.FreeColXMLReader; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void readChildren(FreeColXMLReader xr) throws XMLStreamException {
    // Clear containers.
    if (xr.shouldClearContainers()) {
        this.changes.clear();
    }

    super.readChildren(xr);
}
 
开发者ID:wintertime,项目名称:FreeCol,代码行数:13,代码来源:UnitChangeType.java


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