本文整理匯總了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}