當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。