Fix capitalization in Scope.

This commit is contained in:
Michael Pope 2015-06-10 17:08:45 +09:30 committed by Mike Pope
parent 7ead5aa472
commit caaf4127f7
6 changed files with 56 additions and 33 deletions

View File

@ -26,9 +26,9 @@
magnitude="2">
<scope method-name="isForested" method-value="false" />
<scope method-name="isWater" method-value="false" />
<scope type="model.tile.arctic" matchNegated="true" />
<scope type="model.tile.hills" matchNegated="true" />
<scope type="model.tile.mountains" matchNegated="true" />
<scope type="model.tile.arctic" match-negated="true" />
<scope type="model.tile.hills" match-negated="true" />
<scope type="model.tile.mountains" match-negated="true" />
<change from="model.tile.plains" to="model.tile.mixedForest"/>
<change from="model.tile.grassland" to="model.tile.coniferForest"/>
<change from="model.tile.prairie" to="model.tile.broadleafForest"/>

View File

@ -20,7 +20,7 @@
In case of incompatible changes, please update version number and
XSD schema for validation.
-->
<freecol-specification id="classic" version="0.103">
<freecol-specification id="classic" version="0.104">
<!-- Modifiers that are not attached to other game object
types. They may be modified, but MUST NOT be removed. -->
@ -195,7 +195,7 @@
type="additive" value="2"/>
<modifier id="model.goods.grain" index="10"
type="additive" value="2">
<scope type="model.unit.expertFarmer" matchesNull="false"/>
<scope type="model.unit.expertFarmer" matches-null="false"/>
</modifier>
<modifier id="model.goods.furs" index="10"
type="additive" value="2"/>
@ -244,7 +244,7 @@
type="additive" value="2"/>
<modifier id="model.goods.grain" index="10"
type="additive" value="2">
<scope type="model.unit.expertFarmer" matchesNull="false"/>
<scope type="model.unit.expertFarmer" matches-null="false"/>
</modifier>
</resource-type>
<resource-type id="model.resource.grain">
@ -252,7 +252,7 @@
type="additive" value="2"/>
<modifier id="model.goods.grain" index="10"
type="additive" value="2">
<scope type="model.unit.expertFarmer" matchesNull="false"/>
<scope type="model.unit.expertFarmer" matches-null="false"/>
</modifier>
</resource-type>
<resource-type id="model.resource.fish">
@ -260,7 +260,7 @@
type="additive" value="3"/>
<modifier id="model.goods.fish" index="10"
type="additive" value="3">
<scope type="model.unit.expertFisherman" matchesNull="false"/>
<scope type="model.unit.expertFisherman" matches-null="false"/>
</modifier>
</resource-type>
</resource-types>
@ -1156,9 +1156,9 @@
add-work-turns="0" magnitude="1"
movement-cost="1" zIndex="150">
<scope method-name="isWater" method-value="false"/>
<scope type="model.tile.arctic" matchNegated="true"/>
<scope type="model.tile.hills" matchNegated="true"/>
<scope type="model.tile.mountains" matchNegated="true"/>
<scope type="model.tile.arctic" match-negated="true"/>
<scope type="model.tile.hills" match-negated="true"/>
<scope type="model.tile.mountains" match-negated="true"/>
<disaster id="model.disaster.flood"/>
<modifier id="model.goods.grain" index="50"
type="additive" value="1"/>
@ -1197,9 +1197,9 @@
zIndex="120">
<scope method-name="isWater" method-value="false" />
<scope method-name="isForested" method-value="false" />
<scope type="model.tile.arctic" matchNegated="true" />
<scope type="model.tile.hills" matchNegated="true" />
<scope type="model.tile.mountains" matchNegated="true" />
<scope type="model.tile.arctic" match-negated="true" />
<scope type="model.tile.hills" match-negated="true" />
<scope type="model.tile.mountains" match-negated="true" />
<modifier id="model.goods.grain" index="50"
type="additive" value="1"/>
<modifier id="model.goods.sugar" index="50"
@ -1242,14 +1242,14 @@
<tile-improvement-type id="model.improvement.fishBonusLand" natural="true"
zIndex="250">
<scope method-name="isWater" method-value="true" />
<scope type="model.tile.highSeas" matchNegated="true" />
<scope type="model.tile.highSeas" match-negated="true" />
<modifier id="model.goods.fish" index="50"
type="additive" value="2"/>
</tile-improvement-type>
<tile-improvement-type id="model.improvement.fishBonusRiver" natural="true"
zIndex="250">
<scope method-name="isWater" method-value="true" />
<scope type="model.tile.highSeas" matchNegated="true" />
<scope type="model.tile.highSeas" match-negated="true" />
<modifier id="model.goods.fish" index="50"
type="additive" value="1"/>
</tile-improvement-type>
@ -2107,7 +2107,7 @@
<required-goods id="model.goods.tools" value="20"/>
<modifier id="model.goods.bells" index="70"
type="percentage" value="50">
<scope ability-id="model.ability.person" matchNegated="true"/>
<scope ability-id="model.ability.person" match-negated="true"/>
</modifier>
</building-type>
<building-type id="model.building.newspaper"
@ -2119,7 +2119,7 @@
<modifier id="model.goods.bells" delete="true" />
<modifier id="model.goods.bells" index="70"
type="percentage" value="100">
<scope ability-id="model.ability.person" matchNegated="true"/>
<scope ability-id="model.ability.person" match-negated="true"/>
</modifier>
</building-type>
<building-type id="model.building.customHouse"
@ -2194,7 +2194,7 @@
weight1="10" weight2="1" weight3="1">
<modifier id="model.goods.furs" index="40"
type="percentage" value="100">
<scope ability-id="model.ability.person" matchNegated="false"/>
<scope ability-id="model.ability.person" match-negated="false"/>
</modifier>
</founding-father>
<founding-father id="model.foundingFather.laSalle" type="exploration"
@ -2240,7 +2240,7 @@
weight1="4" weight2="5" weight3="6">
<modifier id="model.goods.bells" index="40"
type="percentage" value="50">
<scope ability-id="model.ability.person" matchNegated="true"/>
<scope ability-id="model.ability.person" match-negated="true"/>
</modifier>
</founding-father>
<founding-father id="model.foundingFather.pocahontas" type="political"
@ -2257,7 +2257,7 @@
set to the current tax. -->
<modifier id="model.goods.bells" index="40"
type="percentage" value="0">
<scope ability-id="model.ability.person" matchNegated="true"/>
<scope ability-id="model.ability.person" match-negated="true"/>
</modifier>
</founding-father>
<founding-father id="model.foundingFather.simonBolivar" type="political"
@ -2284,7 +2284,7 @@
weight1="8" weight2="5" weight3="2">
<modifier id="model.goods.crosses" index="40"
type="percentage" value="50">
<scope ability-id="model.ability.person" matchNegated="true"/>
<scope ability-id="model.ability.person" match-negated="true"/>
</modifier>
</founding-father>
<founding-father id="model.foundingFather.fatherJeanDeBrebeuf" type="religious"

View File

@ -20,7 +20,7 @@
In case of incompatible changes, please update version number and
XSD schema for validation.
-->
<freecol-specification id="freecol" version="0.103" extends="classic">
<freecol-specification id="freecol" version="0.104" extends="classic">
<goods-types>
<goods-type id="model.goods.horses" is-farmed="false"

View File

@ -1096,13 +1096,17 @@
</xs:complexType>
<xs:complexType name="ScopeType">
<xs:attribute name="matchesNull" type="xs:boolean"/>
<xs:attribute name="matchNegated" type="xs:boolean"/>
<xs:attribute name="matches-null" type="xs:boolean"/>
<xs:attribute name="match-negated" type="xs:boolean"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="ability-id" type="AbilityId"/>
<xs:attribute name="ability-value" type="xs:boolean"/>
<xs:attribute name="method-name" type="xs:string"/>
<xs:attribute name="method-value" type="xs:string"/>
<!-- @compat 0.11.3 -->
<xs:attribute name="matchesNull" type="xs:boolean"/>
<xs:attribute name="matchNegated" type="xs:boolean"/>
<!-- end @compat 0.11.3 -->
</xs:complexType>
<xs:complexType name="OperandType">

View File

@ -80,6 +80,7 @@
0.101: Fix capitalization in Limit.
0.102: Fix capitalization in UnitTypeChange.
0.103: incrementType -> increment-type
0.104: Fix capitalization in Scope.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:annotation>
@ -1367,13 +1368,17 @@
</xs:complexType>
<xs:complexType name="ScopeType">
<xs:attribute name="matchesNull" type="xs:boolean"/>
<xs:attribute name="matchNegated" type="xs:boolean"/>
<xs:attribute name="matches-null" type="xs:boolean"/>
<xs:attribute name="match-negated" type="xs:boolean"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="ability-id" type="AbilityId"/>
<xs:attribute name="ability-value" type="xs:boolean"/>
<xs:attribute name="method-name" type="xs:string"/>
<xs:attribute name="method-value" type="xs:string"/>
<!-- @compat 0.11.3 -->
<xs:attribute name="matchesNull" type="xs:boolean"/>
<xs:attribute name="matchNegated" type="xs:boolean"/>
<!-- end @compat 0.11.3 -->
</xs:complexType>
<!-- Identifier types (all simple). funkyCapitalized -->

View File

@ -294,11 +294,15 @@ public class Scope extends FreeColObject {
private static final String ABILITY_ID_TAG = "ability-id";
private static final String ABILITY_VALUE_TAG = "ability-value";
private static final String MATCH_NEGATED_TAG = "matchNegated";
private static final String MATCHES_NULL_TAG = "matchesNull";
private static final String MATCH_NEGATED_TAG = "match-negated";
private static final String MATCHES_NULL_TAG = "matches-null";
private static final String METHOD_NAME_TAG = "method-name";
private static final String METHOD_VALUE_TAG = "method-value";
private static final String TYPE_TAG = "type";
// @compat 0.11.3
private static final String OLD_MATCH_NEGATED_TAG = "matchNegated";
private static final String OLD_MATCHES_NULL_TAG = "matchesNull";
// end @compat 0.11.3
/**
@ -341,9 +345,19 @@ public class Scope extends FreeColObject {
// Scopes do not have ids, no super.readAttributes().
// However, they might in future.
matchNegated = xr.getAttribute(MATCH_NEGATED_TAG, false);
// @compat 0.11.3
if (xr.hasAttribute(OLD_MATCH_NEGATED_TAG)) {
matchNegated = xr.getAttribute(OLD_MATCH_NEGATED_TAG, false);
} else
// end @compat 0.11.3
matchNegated = xr.getAttribute(MATCH_NEGATED_TAG, false);
matchesNull = xr.getAttribute(MATCHES_NULL_TAG, true);
// @compat 0.11.3
if (xr.hasAttribute(OLD_MATCHES_NULL_TAG)) {
matchesNull = xr.getAttribute(OLD_MATCHES_NULL_TAG, true);
} else
// end @compat 0.11.3
matchesNull = xr.getAttribute(MATCHES_NULL_TAG, true);
type = xr.getAttribute(TYPE_TAG, (String)null);
// @compat 0.10.x
@ -378,8 +392,8 @@ public class Scope extends FreeColObject {
if (methodName != null) {
sb.append(" ").append(methodName).append("=").append(methodValue);
}
if (matchesNull) sb.append(" matchesNull");
if (matchNegated) sb.append(" matchNegated");
if (matchesNull) sb.append(" matches-null");
if (matchNegated) sb.append(" match-negated");
sb.append("]");
return sb.toString();
}