Mercurial > repos > snowblizz-super-API-ideas
changeset 310:f7c3c1b39726
Re #99: Define "points" values in GameSystem
* Inline some local variables for readability
* Define defaults in schema
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 20 Feb 2011 20:36:48 +0000 |
parents | 7e1b27843b0d |
children | 5434e648379c |
files | api/Factories/Xml/WarFoundryXmlGameSystemFactory.cs schemas/system.xsd |
diffstat | 2 files changed, 9 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/api/Factories/Xml/WarFoundryXmlGameSystemFactory.cs Sun Feb 20 16:00:11 2011 +0000 +++ b/api/Factories/Xml/WarFoundryXmlGameSystemFactory.cs Sun Feb 20 20:36:48 2011 +0000 @@ -40,16 +40,11 @@ string id = elem.GetAttribute("id"); string name = elem.GetAttribute("name"); GameSystem system = new GameSystem(id, name, mainFactory); - int defaultarmysize = XmlTools.GetIntValueFromAttribute(elem, "defaultArmySize"); - system.SystemArmyDefaultSize = defaultarmysize; - string defaultptsabbreviationsing = elem.GetAttribute("defaultPtsAbbreviationSingular"); - system.SystemPtsAbbrevSingle = defaultptsabbreviationsing; - string defaultPtsabbreviationplur = elem.GetAttribute("defaultPtsAbbreviationPlural"); - system.SystemPtsAbbrevPlural = defaultPtsabbreviationplur; - string defaultPtsnamesing = elem.GetAttribute("defaultPtsNameSingular"); - system.SystemPtsNameSingle = defaultPtsnamesing; - string defaultPtsnameplur = elem.GetAttribute("defaultPtsNamePlural"); - system.SystemPtsNamePlural = defaultPtsnameplur; + system.SystemArmyDefaultSize = XmlTools.GetIntValueFromAttribute (elem, "defaultArmySize"); + system.SystemPtsAbbrevSingle = elem.GetAttribute ("defaultPtsAbbreviationSingular"); + system.SystemPtsAbbrevPlural = elem.GetAttribute ("defaultPtsAbbreviationPlural"); + system.SystemPtsNameSingle = elem.GetAttribute ("defaultPtsNameSingular"); + system.SystemPtsNamePlural = elem.GetAttribute ("defaultPtsNamePlural"); StoreExtraData(system, elem); return system; }
--- a/schemas/system.xsd Sun Feb 20 16:00:11 2011 +0000 +++ b/schemas/system.xsd Sun Feb 20 20:36:48 2011 +0000 @@ -40,10 +40,10 @@ <xs:attribute name="id" type="xs:string" /> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="defaultArmySize" type="core:nonNegativeNonInfiniteDouble" default="0"/> - <xs:attribute name="defaultPtsAbbreviationSingular" type="xs:string" default=""/> - <xs:attribute name="defaultPtsAbbreviationPlural" type="xs:string" default=""/> - <xs:attribute name="defaultPtsNameSingular" type="xs:string" default=""/> - <xs:attribute name="defaultPtsNamePlural" type="xs:string" default=""/> + <xs:attribute name="defaultPtsAbbreviationSingular" type="xs:string" default="pt"/> + <xs:attribute name="defaultPtsAbbreviationPlural" type="xs:string" default="pts"/> + <xs:attribute name="defaultPtsNameSingular" type="xs:string" default="point"/> + <xs:attribute name="defaultPtsNamePlural" type="xs:string" default="points"/> <xs:attribute name="warn" type="xs:boolean" default="false"/> <xs:attribute name="allowAllies" type="xs:boolean" default="true"/> <xs:anyAttribute processContents="lax"/>