本文整理汇总了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);
}