annotate api/Factories/Xml/WarFoundryXmlElementName.cs @ 302:b24a78cfd314

Re #238: subfolders datafolder * Add support for recursing sub-folders
author IBBoard <dev@ibboard.co.uk>
date Tue, 25 Jan 2011 21:03:35 +0000
parents cd657faa0c05
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
283
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
1 // This file (WarFoundryXmlElementName.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2009 IBBoard.
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
2 //
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
3 // 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.
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
4
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
5 using System;
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
6 using System.Collections.Generic;
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
7 using IBBoard.Xml;
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
8
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
9 namespace IBBoard.WarFoundry.API.Factories.Xml
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
10 {
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
11 /// <summary>
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
12 /// An enumeration class for valid WarFoundry XML elements, designed to imitate Java's extensible complex object enumerations.
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
13 /// </summary>
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
14 public class WarFoundryXmlElementName : IXmlElementName, IExtendedEnum<string>
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
15 {
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
16 public static WarFoundryXmlElementName SYSTEM_ELEMENT = new WarFoundryXmlElementName("SYSTEM_ELEMENT", "system");
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
17 public static WarFoundryXmlElementName ARMY_ELEMENT = new WarFoundryXmlElementName("ARMY_ELEMENT", "army");
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
18 public static WarFoundryXmlElementName RACE_ELEMENT = new WarFoundryXmlElementName("RACE_ELEMENT", "race");
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
19 public static WarFoundryXmlElementName ARMY_DEFAULTNAME_ELEMENT = new WarFoundryXmlElementName("ARMY_DEFAULTNAME_ELEMENT", "defaultName");
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
20 public static WarFoundryXmlElementName CATEGORIES_ELEMENT = new WarFoundryXmlElementName("CATEGORIES_ELEMENT", "categories");
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
21 public static WarFoundryXmlElementName CATEGORY_ELEMENT = new WarFoundryXmlElementName("CATEGORY_ELEMENT", "cat");
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
22 public static WarFoundryXmlElementName UNITTYPES_ELEMENT = new WarFoundryXmlElementName("UNITTYPES_ELEMENT", "units");
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
23 public static WarFoundryXmlElementName UNITTYPE_ELEMENT = new WarFoundryXmlElementName("UNITTYPE_ELEMENT", "unit");
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
24 public static WarFoundryXmlElementName RACE_EQUIPMENT_ITEMS_ELEMENT = new WarFoundryXmlElementName("RACE_EQUIPMENT_ITEMS_ELEMENT", "equipment");
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
25 public static WarFoundryXmlElementName RACE_EQUIPMENT_ITEM_ELEMENT = new WarFoundryXmlElementName("RACE_EQUIPMENT_ITEMS_ELEMENT", "equipmentItem");
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
26
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
27 private static ICollection<WarFoundryXmlElementName> enumValues;
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
28 private string name;
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
29 private string val;
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
30
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
31 private WarFoundryXmlElementName(string elemName, string elemVal)
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
32 {
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
33 name = elemName;
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
34 val = elemVal;
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
35 }
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
36
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
37 public string Name
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
38 {
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
39 get {
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
40 return name;
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
41 }
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
42 }
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
43
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
44 public string Value
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
45 {
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
46 get {
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
47 return val;
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
48 }
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
49 }
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
50
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
51 /// <summary>
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
52 /// Gets an ICollection of the values so that they can be looped over like a standard enumeration.
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
53 /// </summary>
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
54 /// <returns>
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
55 /// A <see cref="ICollection`1"/> of all of the static 'enumeration' values of the class.
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
56 /// </returns>
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
57 public static ICollection<WarFoundryXmlElementName> GetEnumValues()
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
58 {
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
59 if (enumValues == null)
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
60 {
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
61 enumValues = new WarFoundryXmlElementName[]{SYSTEM_ELEMENT, ARMY_ELEMENT, RACE_ELEMENT, CATEGORIES_ELEMENT, CATEGORY_ELEMENT, UNITTYPES_ELEMENT, UNITTYPE_ELEMENT};
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
62 }
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
63
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
64 return enumValues;
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
65 }
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
66 }
cd657faa0c05 * Merge branch into trunk (branch contained some fixes that should have been made on trunk)
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
67 }