# HG changeset patch # User IBBoard # Date 1287602817 0 # Node ID cd657faa0c058cc7438772ad65fc431caa84c693 # Parent cd082d7bd4d958f78c6e6bede852ca8afa5e8ada * Merge branch into trunk (branch contained some fixes that should have been made on trunk) no-open-ticket diff -r cd082d7bd4d9 -r cd657faa0c05 AssemblyInfo.cs --- a/AssemblyInfo.cs Sat Sep 04 10:26:46 2010 +0000 +++ b/AssemblyInfo.cs Wed Oct 20 19:26:57 2010 +0000 @@ -30,7 +30,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("0.0.1.*")] +[assembly: AssemblyVersion("0.1.0.*")] // // In order to sign your assembly you must specify a key to use. Refer to the diff -r cd082d7bd4d9 -r cd657faa0c05 IBBoard.WarFoundry.API.csproj --- a/IBBoard.WarFoundry.API.csproj Sat Sep 04 10:26:46 2010 +0000 +++ b/IBBoard.WarFoundry.API.csproj Wed Oct 20 19:26:57 2010 +0000 @@ -1,15 +1,38 @@ - - + + Debug AnyCPU - 8.0.50727 + 9.0.30729 2.0 {951E6C7A-7FBA-4F68-9D9E-F48618BB9626} Library Properties IBBoard.WarFoundry.API IBBoard.WarFoundry.API + + + 2.0 + + + v2.0 + + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true true @@ -37,6 +60,7 @@ --> + @@ -162,12 +186,6 @@ - - {5DFD64F6-FC2B-4B4F-B92E-483BAC468105} - IBBoard - - - @@ -175,4 +193,42 @@ libs\ICSharpCode.SharpZipLib.dll + + + {5DFD64F6-FC2B-4B4F-B92E-483BAC468105} + IBBoard + + + + + False + .NET Framework Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + false + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + \ No newline at end of file diff -r cd082d7bd4d9 -r cd657faa0c05 api/Factories/Xml/WarFoundryXmlArmyParser.cs --- a/api/Factories/Xml/WarFoundryXmlArmyParser.cs Sat Sep 04 10:26:46 2010 +0000 +++ b/api/Factories/Xml/WarFoundryXmlArmyParser.cs Wed Oct 20 19:26:57 2010 +0000 @@ -106,33 +106,24 @@ foreach (XmlElement elem in WarFoundryXmlFactoryUtils.SelectNodes(unitElem, "army:equipment/army:equipItem")) { string equipID = elem.GetAttribute("id"); - bool isCustom = XmlTools.GetBoolValueFromAttribute(elem, "isCustomEquipment"); - - if (!isCustom) - { - UnitEquipmentItem item = unit.UnitType.GetEquipmentItem(equipID); - - if (item == null) - { - throw new RequiredDataMissingException(file.Name, "Equipment Item", equipID); - } + UnitEquipmentItem item = unit.UnitType.GetEquipmentItem(equipID); - double amount = XmlTools.GetDoubleValueFromAttribute(elem, "amount"); - string equipTypeString = elem.GetAttribute("amountType"); + if (item == null) + { + throw new RequiredDataMissingException(file.Name, "Equipment Item", equipID); + } - if (equipTypeString == "ratio") - { - unit.SetEquipmentRatio(item, amount); - } - else - { - //amount should be a whole number, so do type-cast rounding - unit.SetEquipmentAmount(item, (int) amount); - } + double amount = XmlTools.GetDoubleValueFromAttribute(elem, "amount"); + string equipTypeString = elem.GetAttribute("amountType"); + + if (equipTypeString == "ratio") + { + unit.SetEquipmentRatio(item, amount); } else { - //TODO: Load custom equipment + //amount should be a whole number, so do type-cast rounding + unit.SetEquipmentAmount(item, (int) amount); } } } diff -r cd082d7bd4d9 -r cd657faa0c05 api/Factories/Xml/WarFoundryXmlElementName.cs --- a/api/Factories/Xml/WarFoundryXmlElementName.cs Sat Sep 04 10:26:46 2010 +0000 +++ b/api/Factories/Xml/WarFoundryXmlElementName.cs Wed Oct 20 19:26:57 2010 +0000 @@ -1,66 +1,67 @@ -// This file (WarFoundryXmlElementName.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2009 IBBoard. -// -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. - -using System; -using System.Collections.Generic; -using IBBoard.Xml; - -namespace IBBoard.WarFoundry.API.Factories.Xml -{ - /// - /// An enumeration class for valid WarFoundry XML elements, designed to imitate Java's extensible complex object enumerations. - /// - public class WarFoundryXmlElementName : IXmlElementName, IExtendedEnum - { - public static WarFoundryXmlElementName SYSTEM_ELEMENT = new WarFoundryXmlElementName("SYSTEM_ELEMENT", "system"); - public static WarFoundryXmlElementName ARMY_ELEMENT = new WarFoundryXmlElementName("ARMY_ELEMENT", "army"); - public static WarFoundryXmlElementName RACE_ELEMENT = new WarFoundryXmlElementName("RACE_ELEMENT", "race"); - public static WarFoundryXmlElementName CATEGORIES_ELEMENT = new WarFoundryXmlElementName("CATEGORIES_ELEMENT", "categories"); - public static WarFoundryXmlElementName CATEGORY_ELEMENT = new WarFoundryXmlElementName("CATEGORY_ELEMENT", "cat"); - public static WarFoundryXmlElementName UNITTYPES_ELEMENT = new WarFoundryXmlElementName("UNITTYPES_ELEMENT", "units"); - public static WarFoundryXmlElementName UNITTYPE_ELEMENT = new WarFoundryXmlElementName("UNITTYPE_ELEMENT", "unit"); - public static WarFoundryXmlElementName RACE_EQUIPMENT_ITEMS_ELEMENT = new WarFoundryXmlElementName("RACE_EQUIPMENT_ITEMS_ELEMENT", "equipment"); - public static WarFoundryXmlElementName RACE_EQUIPMENT_ITEM_ELEMENT = new WarFoundryXmlElementName("RACE_EQUIPMENT_ITEMS_ELEMENT", "equipmentItem"); - - private static ICollection enumValues; - private string name; - private string val; - - private WarFoundryXmlElementName(string elemName, string elemVal) - { - name = elemName; - val = elemVal; - } - - public string Name - { - get { - return name; - } - } - - public string Value - { - get { - return val; - } - } - - /// - /// Gets an ICollection of the values so that they can be looped over like a standard enumeration. - /// - /// - /// A of all of the static 'enumeration' values of the class. - /// - public static ICollection GetEnumValues() - { - if (enumValues == null) - { - enumValues = new WarFoundryXmlElementName[]{SYSTEM_ELEMENT, ARMY_ELEMENT, RACE_ELEMENT, CATEGORIES_ELEMENT, CATEGORY_ELEMENT, UNITTYPES_ELEMENT, UNITTYPE_ELEMENT}; - } - - return enumValues; - } - } -} +// This file (WarFoundryXmlElementName.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2009 IBBoard. +// +// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. + +using System; +using System.Collections.Generic; +using IBBoard.Xml; + +namespace IBBoard.WarFoundry.API.Factories.Xml +{ + /// + /// An enumeration class for valid WarFoundry XML elements, designed to imitate Java's extensible complex object enumerations. + /// + public class WarFoundryXmlElementName : IXmlElementName, IExtendedEnum + { + public static WarFoundryXmlElementName SYSTEM_ELEMENT = new WarFoundryXmlElementName("SYSTEM_ELEMENT", "system"); + public static WarFoundryXmlElementName ARMY_ELEMENT = new WarFoundryXmlElementName("ARMY_ELEMENT", "army"); + public static WarFoundryXmlElementName RACE_ELEMENT = new WarFoundryXmlElementName("RACE_ELEMENT", "race"); + public static WarFoundryXmlElementName ARMY_DEFAULTNAME_ELEMENT = new WarFoundryXmlElementName("ARMY_DEFAULTNAME_ELEMENT", "defaultName"); + public static WarFoundryXmlElementName CATEGORIES_ELEMENT = new WarFoundryXmlElementName("CATEGORIES_ELEMENT", "categories"); + public static WarFoundryXmlElementName CATEGORY_ELEMENT = new WarFoundryXmlElementName("CATEGORY_ELEMENT", "cat"); + public static WarFoundryXmlElementName UNITTYPES_ELEMENT = new WarFoundryXmlElementName("UNITTYPES_ELEMENT", "units"); + public static WarFoundryXmlElementName UNITTYPE_ELEMENT = new WarFoundryXmlElementName("UNITTYPE_ELEMENT", "unit"); + public static WarFoundryXmlElementName RACE_EQUIPMENT_ITEMS_ELEMENT = new WarFoundryXmlElementName("RACE_EQUIPMENT_ITEMS_ELEMENT", "equipment"); + public static WarFoundryXmlElementName RACE_EQUIPMENT_ITEM_ELEMENT = new WarFoundryXmlElementName("RACE_EQUIPMENT_ITEMS_ELEMENT", "equipmentItem"); + + private static ICollection enumValues; + private string name; + private string val; + + private WarFoundryXmlElementName(string elemName, string elemVal) + { + name = elemName; + val = elemVal; + } + + public string Name + { + get { + return name; + } + } + + public string Value + { + get { + return val; + } + } + + /// + /// Gets an ICollection of the values so that they can be looped over like a standard enumeration. + /// + /// + /// A of all of the static 'enumeration' values of the class. + /// + public static ICollection GetEnumValues() + { + if (enumValues == null) + { + enumValues = new WarFoundryXmlElementName[]{SYSTEM_ELEMENT, ARMY_ELEMENT, RACE_ELEMENT, CATEGORIES_ELEMENT, CATEGORY_ELEMENT, UNITTYPES_ELEMENT, UNITTYPE_ELEMENT}; + } + + return enumValues; + } + } +} diff -r cd082d7bd4d9 -r cd657faa0c05 api/Factories/Xml/WarFoundryXmlRaceFactory.cs Binary file api/Factories/Xml/WarFoundryXmlRaceFactory.cs has changed diff -r cd082d7bd4d9 -r cd657faa0c05 api/Objects/Race.cs --- a/api/Objects/Race.cs Sat Sep 04 10:26:46 2010 +0000 +++ b/api/Objects/Race.cs Wed Oct 20 19:26:57 2010 +0000 @@ -1,302 +1,317 @@ -// This file (Race.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2007, 2008, 2009 IBBoard. -// -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; -using IBBoard.IO; -using IBBoard.WarFoundry.API.Factories; - -namespace IBBoard.WarFoundry.API.Objects -{ - public class Race : WarFoundryStagedLoadingObject - { - public static string SYSTEM_DEFAULT_RACE_ID = "GameDefault"; - - private string subID; - private GameSystem system; - private Dictionary> unitTypesByCat; - private Dictionary unitTypes = new Dictionary(); - private Dictionary equipment = new Dictionary(); - private Dictionary abilities = new Dictionary(); - private Dictionary categories = new Dictionary(); - private Dictionary memberTypes = new Dictionary(); - - public Race(string raceID, string raceName, GameSystem gameSystem, IWarFoundryFactory creatingFactory) : this(raceID, "", raceName, gameSystem, creatingFactory) - { - } - - public Race(string raceID, string raceSubID, string raceName, GameSystem gameSystem, IWarFoundryFactory creatingFactory) : base(raceID + (raceSubID!="" ? "_"+raceSubID : ""), raceName, creatingFactory) - { - subID = (raceSubID == null ? "" : raceSubID); - system = gameSystem; - } - - public string SubID - { - get { return subID; } - set { subID = (value == null ? "" : value.Trim()); } - } - - public GameSystem GameSystem - { - get { return system; } - set - { - if (value == null) - { - throw new ArgumentException("Game system for a race cannot be null"); - } - - system = value; - } - } - - public void AddCategory(Category cat) - { - categories[cat.ID] = cat; - } - - /// - /// Gets a category from its ID. Attempts to get the category from the race's overrides, or else it falls back to getting the Game System's category with that ID. - /// - /// - /// The ID of the category to get - /// - /// - /// The Category with the specified ID, or null if one doesn't exist. - /// - public Category GetCategory(string id) - { - EnsureFullyLoaded(); - Category cat = null; - categories.TryGetValue(id, out cat); - - if (cat == null) - { - cat = GameSystem.GetCategory(id); - } - - return cat; - } - - public Category[] Categories - { - get - { - EnsureFullyLoaded(); - Category[] cats; - - if (!HasCategoryOverrides()) - { - cats = GameSystem.Categories; - } - else - { - cats = DictionaryUtils.ToArray(categories); - } - - return cats; - } - } - - public bool HasCategoryOverrides() - { - EnsureFullyLoaded(); - return categories.Count > 0; - } - - public void AddEquipmentItem(EquipmentItem item) - { - //TODO: Throw DuplicateItemException - equipment.Add(item.ID, item); - } - - public EquipmentItem GetEquipmentItem(string id) - { - EnsureFullyLoaded(); - return DictionaryUtils.GetValue(equipment, id); - } - - public List GetEquipmentList() - { - EnsureFullyLoaded(); - List items = new List(); - - foreach (EquipmentItem item in equipment.Values) - { - items.Add(item); - } - - return items; - } - - public void AddUnitType(UnitType type) - { - CacheUnitType(type); - unitTypes.Add(type.ID, type); - } - - public UnitType[] GetUnitTypes(Category cat) - { - EnsureFullyLoaded(); - BuildUnitTypesByCategoryCache(); - Dictionary unitTypesDictionary; - unitTypesByCat.TryGetValue(cat, out unitTypesDictionary); - UnitType[] unitTypesArray; - - if (unitTypesDictionary == null) - { - unitTypesArray = new UnitType[0]; - } - else - { - unitTypesArray = DictionaryUtils.ToArray(unitTypesDictionary); - } - - return unitTypesArray; - } - - private void CacheUnitType(UnitType unit) - { - BuildUnitTypesByCategoryCache(); - - foreach (Category cat in unit.Categories) - { - Dictionary catUnitTypes = DictionaryUtils.GetValue(unitTypesByCat, cat); - - if (catUnitTypes == null) - { - throw new InvalidFileException(String.Format("Unit type {0} with name {1} is a unit of an undefined category ({2})", unit.ID, unit.Name, cat.ID)); - } - - catUnitTypes.Add(unit.ID, unit); - } - } - - private void BuildUnitTypesByCategoryCache() - { - if (unitTypesByCat == null) - { - DoBuildUnitTypesByCategoryCache(); - } - } - - private void DoBuildUnitTypesByCategoryCache() - { - unitTypesByCat = new Dictionary>(); - - foreach (Category category in Categories) - { - unitTypesByCat.Add(category, new Dictionary()); - } - - foreach (UnitType unit in unitTypes.Values) - { - CacheUnitType(unit); - } - } - - public UnitType GetUnitType(string id) - { - EnsureFullyLoaded(); - return DictionaryUtils.GetValue(unitTypes, id); - } - - public List GetAbilityList() - { - EnsureFullyLoaded(); - List items = new List(); - items.AddRange(abilities.Values); - return items; - } - - public void AddAbility(Ability newAbility) - { - //TODO: Throw DuplicateItemException - abilities.Add(newAbility.ID, newAbility); - } - - [Obsolete("Use AddAbility method instead")] - public void SetAbilities(Dictionary newAbilities) - { - foreach (Ability ability in newAbilities.Values) - { - AddAbility(ability); - } - } - - public Ability GetAbility(string id) - { - EnsureFullyLoaded(); - return DictionaryUtils.GetValue(abilities, id); - } - - protected virtual Dictionary RaceUnitTypes - { - get { return RaceRawUnitTypes; } - set { RaceRawUnitTypes = value; } - } - - protected virtual Dictionary RaceEquipment - { - get { return RaceRawEquipment; } - set { RaceRawEquipment = value; } - } - - protected virtual Dictionary RaceAbilities - { - get { return RaceRawAbilities; } - set { RaceRawAbilities = value; } - } - - protected Dictionary RaceRawUnitTypes - { - get { return unitTypes; } - set { unitTypes = value; } - } - - protected Dictionary RaceRawEquipment - { - get { return equipment; } - set { equipment = value; } - } - - protected Dictionary RaceRawAbilities - { - get { return abilities; } - set { abilities = value; } - } - - public void AddUnitMemberType(UnitMemberType memberType) - { - memberTypes[memberType.ID] = memberType; - } - - /// - /// Gets a unit member type by its ID. - /// - /// - /// The ID of the unit member type to get - /// - /// - /// The UnitMemberType with the specified ID, or null if one doesn't exist. - /// - public UnitMemberType GetUnitMemberType(string id) - { - EnsureFullyLoaded(); - return DictionaryUtils.GetValue(memberTypes, id); - } - - public UnitMemberType[] UnitMemberTypes - { - get - { - EnsureFullyLoaded(); - return DictionaryUtils.ToArray(memberTypes); - } - } - } -} +// This file (Race.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2007, 2008, 2009 IBBoard. +// +// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using IBBoard.IO; +using IBBoard.WarFoundry.API.Factories; + +namespace IBBoard.WarFoundry.API.Objects +{ + public class Race : WarFoundryStagedLoadingObject + { + public static string SYSTEM_DEFAULT_RACE_ID = "GameDefault"; + + private string subID; + private GameSystem system; + private string defaultArmyName = ""; + private Dictionary> unitTypesByCat; + private Dictionary unitTypes = new Dictionary(); + private Dictionary equipment = new Dictionary(); + private Dictionary abilities = new Dictionary(); + private Dictionary categories = new Dictionary(); + private Dictionary memberTypes = new Dictionary(); + + public Race(string raceID, string raceName, GameSystem gameSystem, IWarFoundryFactory creatingFactory) : this(raceID, "", raceName, gameSystem, creatingFactory) + { + } + + public Race(string raceID, string raceSubID, string raceName, GameSystem gameSystem, IWarFoundryFactory creatingFactory) : base(raceID + (raceSubID != "" ? "_" + raceSubID : ""), raceName, creatingFactory) + { + subID = (raceSubID == null ? "" : raceSubID); + system = gameSystem; + } + + public string SubID + { + get { return subID; } + set { subID = (value == null ? "" : value.Trim()); } + } + + public GameSystem GameSystem + { + get { return system; } + set + { + if (value == null) + { + throw new ArgumentException("Game system for a race cannot be null"); + } + + system = value; + } + } + + public string ArmyDefaultName + { + get { return defaultArmyName; } + set + { + if (value == null) + { + throw new ArgumentException("No default army name"); + } + + defaultArmyName = value; + } + } + + public void AddCategory(Category cat) + { + categories[cat.ID] = cat; + } + + /// + /// Gets a category from its ID. Attempts to get the category from the race's overrides, or else it falls back to getting the Game System's category with that ID. + /// + /// + /// The ID of the category to get + /// + /// + /// The Category with the specified ID, or null if one doesn't exist. + /// + public Category GetCategory(string id) + { + EnsureFullyLoaded(); + Category cat = null; + categories.TryGetValue(id, out cat); + + if (cat == null) + { + cat = GameSystem.GetCategory(id); + } + + return cat; + } + + public Category[] Categories + { + get + { + EnsureFullyLoaded(); + Category[] cats; + + if (!HasCategoryOverrides()) + { + cats = GameSystem.Categories; + } + else + { + cats = DictionaryUtils.ToArray(categories); + } + + return cats; + } + } + + public bool HasCategoryOverrides() + { + EnsureFullyLoaded(); + return categories.Count > 0; + } + + public void AddEquipmentItem(EquipmentItem item) + { + //TODO: Throw DuplicateItemException + equipment.Add(item.ID, item); + } + + public EquipmentItem GetEquipmentItem(string id) + { + EnsureFullyLoaded(); + return DictionaryUtils.GetValue(equipment, id); + } + + public List GetEquipmentList() + { + EnsureFullyLoaded(); + List items = new List(); + + foreach (EquipmentItem item in equipment.Values) + { + items.Add(item); + } + + return items; + } + + public void AddUnitType(UnitType type) + { + CacheUnitType(type); + unitTypes.Add(type.ID, type); + } + + public UnitType[] GetUnitTypes(Category cat) + { + EnsureFullyLoaded(); + BuildUnitTypesByCategoryCache(); + Dictionary unitTypesDictionary; + unitTypesByCat.TryGetValue(cat, out unitTypesDictionary); + UnitType[] unitTypesArray; + + if (unitTypesDictionary == null) + { + unitTypesArray = new UnitType[0]; + } + else + { + unitTypesArray = DictionaryUtils.ToArray(unitTypesDictionary); + } + + return unitTypesArray; + } + + private void CacheUnitType(UnitType unit) + { + BuildUnitTypesByCategoryCache(); + + foreach (Category cat in unit.Categories) + { + Dictionary catUnitTypes = DictionaryUtils.GetValue(unitTypesByCat, cat); + + if (catUnitTypes == null) + { + throw new InvalidFileException(String.Format("Unit type {0} with name {1} is a unit of an undefined category ({2})", unit.ID, unit.Name, cat.ID)); + } + + catUnitTypes.Add(unit.ID, unit); + } + } + + private void BuildUnitTypesByCategoryCache() + { + if (unitTypesByCat == null) + { + DoBuildUnitTypesByCategoryCache(); + } + } + + private void DoBuildUnitTypesByCategoryCache() + { + unitTypesByCat = new Dictionary>(); + + foreach (Category category in Categories) + { + unitTypesByCat.Add(category, new Dictionary()); + } + + foreach (UnitType unit in unitTypes.Values) + { + CacheUnitType(unit); + } + } + + public UnitType GetUnitType(string id) + { + EnsureFullyLoaded(); + return DictionaryUtils.GetValue(unitTypes, id); + } + + public List GetAbilityList() + { + EnsureFullyLoaded(); + List items = new List(); + items.AddRange(abilities.Values); + return items; + } + + public void AddAbility(Ability newAbility) + { + //TODO: Throw DuplicateItemException + abilities.Add(newAbility.ID, newAbility); + } + + [Obsolete("Use AddAbility method instead")] + public void SetAbilities(Dictionary newAbilities) + { + foreach (Ability ability in newAbilities.Values) + { + AddAbility(ability); + } + } + + public Ability GetAbility(string id) + { + EnsureFullyLoaded(); + return DictionaryUtils.GetValue(abilities, id); + } + + protected virtual Dictionary RaceUnitTypes + { + get { return RaceRawUnitTypes; } + set { RaceRawUnitTypes = value; } + } + + protected virtual Dictionary RaceEquipment + { + get { return RaceRawEquipment; } + set { RaceRawEquipment = value; } + } + + protected virtual Dictionary RaceAbilities + { + get { return RaceRawAbilities; } + set { RaceRawAbilities = value; } + } + + protected Dictionary RaceRawUnitTypes + { + get { return unitTypes; } + set { unitTypes = value; } + } + + protected Dictionary RaceRawEquipment + { + get { return equipment; } + set { equipment = value; } + } + + protected Dictionary RaceRawAbilities + { + get { return abilities; } + set { abilities = value; } + } + + public void AddUnitMemberType(UnitMemberType memberType) + { + memberTypes[memberType.ID] = memberType; + } + + /// + /// Gets a unit member type by its ID. + /// + /// + /// The ID of the unit member type to get + /// + /// + /// The UnitMemberType with the specified ID, or null if one doesn't exist. + /// + public UnitMemberType GetUnitMemberType(string id) + { + EnsureFullyLoaded(); + return DictionaryUtils.GetValue(memberTypes, id); + } + + public UnitMemberType[] UnitMemberTypes + { + get + { + EnsureFullyLoaded(); + return DictionaryUtils.ToArray(memberTypes); + } + } + } +} diff -r cd082d7bd4d9 -r cd657faa0c05 schemas/race.xsd --- a/schemas/race.xsd Sat Sep 04 10:26:46 2010 +0000 +++ b/schemas/race.xsd Wed Oct 20 19:26:57 2010 +0000 @@ -67,6 +67,7 @@ +