annotate api/Objects/Race.cs @ 279:51b3027a7dae

Re #295: Index out of bounds when changing unit size and clicking in equipment list * Trigger 'fake' equipment amount changed events when the unit size changes for all ratio equipment - ratio won't have changed, but absolute number will
author IBBoard <dev@ibboard.co.uk>
date Wed, 14 Jul 2010 20:01:14 +0000
parents 3b395ab8784d
children cd657faa0c05 8981fc45fe17
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
104
2f3cafb69799 Re #121: Migrate to AGPL license
IBBoard <dev@ibboard.co.uk>
parents: 85
diff changeset
1 // This file (Race.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2007, 2008, 2009 IBBoard.
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
2 //
104
2f3cafb69799 Re #121: Migrate to AGPL license
IBBoard <dev@ibboard.co.uk>
parents: 85
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.
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
4
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
5 using System;
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
6 using System.Collections.Generic;
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
7 using System.IO;
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
8 using System.Xml;
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
9 using IBBoard.IO;
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
10 using IBBoard.WarFoundry.API.Factories;
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
11
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
12 namespace IBBoard.WarFoundry.API.Objects
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
13 {
8
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
14 public class Race : WarFoundryStagedLoadingObject
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
15 {
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
16 public static string SYSTEM_DEFAULT_RACE_ID = "GameDefault";
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
17
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
18 private string subID;
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
19 private GameSystem system;
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
20 private Dictionary<Category, Dictionary<string, UnitType>> unitTypesByCat;
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
21 private Dictionary<string, UnitType> unitTypes = new Dictionary<string,UnitType>();
8
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
22 private Dictionary<string, EquipmentItem> equipment = new Dictionary<string,EquipmentItem>();
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
23 private Dictionary<string, Ability> abilities = new Dictionary<string,Ability>();
8
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
24 private Dictionary<string, Category> categories = new Dictionary<string,Category>();
252
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
25 private Dictionary<string, UnitMemberType> memberTypes = new Dictionary<string, UnitMemberType>();
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
26
54
3a90f70dac73 Re #61 - Complete structure of WarFoundry API objects
IBBoard <dev@ibboard.co.uk>
parents: 47
diff changeset
27 public Race(string raceID, string raceName, GameSystem gameSystem, IWarFoundryFactory creatingFactory) : this(raceID, "", raceName, gameSystem, creatingFactory)
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
28 {
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
29 }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
30
54
3a90f70dac73 Re #61 - Complete structure of WarFoundry API objects
IBBoard <dev@ibboard.co.uk>
parents: 47
diff changeset
31 public Race(string raceID, string raceSubID, string raceName, GameSystem gameSystem, IWarFoundryFactory creatingFactory) : base(raceID + (raceSubID!="" ? "_"+raceSubID : ""), raceName, creatingFactory)
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
32 {
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
33 subID = (raceSubID == null ? "" : raceSubID);
54
3a90f70dac73 Re #61 - Complete structure of WarFoundry API objects
IBBoard <dev@ibboard.co.uk>
parents: 47
diff changeset
34 system = gameSystem;
3a90f70dac73 Re #61 - Complete structure of WarFoundry API objects
IBBoard <dev@ibboard.co.uk>
parents: 47
diff changeset
35 }
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
36
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
37 public string SubID
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
38 {
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
39 get { return subID; }
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
40 set { subID = (value == null ? "" : value.Trim()); }
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
41 }
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
42
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
43 public GameSystem GameSystem
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
44 {
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
45 get { return system; }
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
46 set
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
47 {
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
48 if (value == null)
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
49 {
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
50 throw new ArgumentException("Game system for a race cannot be null");
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
51 }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
52
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
53 system = value;
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
54 }
8
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
55 }
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
56
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
57 public void AddCategory(Category cat)
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
58 {
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
59 categories[cat.ID] = cat;
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
60 }
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
61
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
62 /// <summary>
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
63 /// 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.
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
64 /// </summary>
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
65 /// <param name="id">
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
66 /// The ID of the category to get
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
67 /// </param>
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
68 /// <returns>
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
69 /// The <code>Category</code> with the specified ID, or null if one doesn't exist.
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
70 /// </returns>
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
71 public Category GetCategory(string id)
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
72 {
8
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
73 EnsureFullyLoaded();
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
74 Category cat = null;
8
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
75 categories.TryGetValue(id, out cat);
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
76
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
77 if (cat == null)
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
78 {
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
79 cat = GameSystem.GetCategory(id);
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
80 }
8
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
81
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
82 return cat;
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
83 }
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
84
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
85 public Category[] Categories
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
86 {
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
87 get
8
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
88 {
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
89 EnsureFullyLoaded();
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
90 Category[] cats;
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
91
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
92 if (!HasCategoryOverrides())
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
93 {
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
94 cats = GameSystem.Categories;
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
95 }
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
96 else
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
97 {
14
0770e5cbba7c Closes #21 - File loading in order
IBBoard <dev@ibboard.co.uk>
parents: 13
diff changeset
98 cats = DictionaryUtils.ToArray<string, Category>(categories);
8
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
99 }
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
100
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
101 return cats;
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
102 }
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
103 }
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
104
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
105 public bool HasCategoryOverrides()
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
106 {
118
d39de20f2ba1 Re #54: Add army loading support
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
107 EnsureFullyLoaded();
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
108 return categories.Count > 0;
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
109 }
11
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
110
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
111 public void AddEquipmentItem(EquipmentItem item)
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
112 {
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
113 //TODO: Throw DuplicateItemException
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
114 equipment.Add(item.ID, item);
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
115 }
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
116
85
46ad6f478203 Re #50: Complete core loading of WarFoundry XML files
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
117 public EquipmentItem GetEquipmentItem(string id)
8
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
118 {
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
119 EnsureFullyLoaded();
85
46ad6f478203 Re #50: Complete core loading of WarFoundry XML files
IBBoard <dev@ibboard.co.uk>
parents: 82
diff changeset
120 return DictionaryUtils.GetValue(equipment, id);
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
121 }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
122
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
123 public List<EquipmentItem> GetEquipmentList()
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
124 {
118
d39de20f2ba1 Re #54: Add army loading support
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
125 EnsureFullyLoaded();
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
126 List<EquipmentItem> items = new List<EquipmentItem>();
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
127
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
128 foreach (EquipmentItem item in equipment.Values)
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
129 {
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
130 items.Add(item);
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
131 }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
132
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
133 return items;
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
134 }
11
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
135
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
136 public void AddUnitType(UnitType type)
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
137 {
13
ad8eaed12e66 Re #9 - Load in smaller methods
IBBoard <dev@ibboard.co.uk>
parents: 11
diff changeset
138 CacheUnitType(type);
11
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
139 unitTypes.Add(type.ID, type);
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
140 }
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
141
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
142 public UnitType[] GetUnitTypes(Category cat)
11
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
143 {
118
d39de20f2ba1 Re #54: Add army loading support
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
144 EnsureFullyLoaded();
11
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
145 BuildUnitTypesByCategoryCache();
8
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
146 Dictionary<string, UnitType> unitTypesDictionary;
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
147 unitTypesByCat.TryGetValue(cat, out unitTypesDictionary);
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
148 UnitType[] unitTypesArray;
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
149
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
150 if (unitTypesDictionary == null)
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
151 {
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
152 unitTypesArray = new UnitType[0];
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
153 }
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
154 else
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
155 {
14
0770e5cbba7c Closes #21 - File loading in order
IBBoard <dev@ibboard.co.uk>
parents: 13
diff changeset
156 unitTypesArray = DictionaryUtils.ToArray<string, UnitType>(unitTypesDictionary);
8
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
157 }
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
158
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
159 return unitTypesArray;
8
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
160 }
11
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
161
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
162 private void CacheUnitType(UnitType unit)
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
163 {
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
164 BuildUnitTypesByCategoryCache();
258
3b395ab8784d Re #270: Add multiple categories to API
IBBoard <dev@ibboard.co.uk>
parents: 252
diff changeset
165
3b395ab8784d Re #270: Add multiple categories to API
IBBoard <dev@ibboard.co.uk>
parents: 252
diff changeset
166 foreach (Category cat in unit.Categories)
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
167 {
258
3b395ab8784d Re #270: Add multiple categories to API
IBBoard <dev@ibboard.co.uk>
parents: 252
diff changeset
168 Dictionary<string, UnitType> catUnitTypes = DictionaryUtils.GetValue(unitTypesByCat, cat);
3b395ab8784d Re #270: Add multiple categories to API
IBBoard <dev@ibboard.co.uk>
parents: 252
diff changeset
169
3b395ab8784d Re #270: Add multiple categories to API
IBBoard <dev@ibboard.co.uk>
parents: 252
diff changeset
170 if (catUnitTypes == null)
3b395ab8784d Re #270: Add multiple categories to API
IBBoard <dev@ibboard.co.uk>
parents: 252
diff changeset
171 {
3b395ab8784d Re #270: Add multiple categories to API
IBBoard <dev@ibboard.co.uk>
parents: 252
diff changeset
172 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));
3b395ab8784d Re #270: Add multiple categories to API
IBBoard <dev@ibboard.co.uk>
parents: 252
diff changeset
173 }
3b395ab8784d Re #270: Add multiple categories to API
IBBoard <dev@ibboard.co.uk>
parents: 252
diff changeset
174
3b395ab8784d Re #270: Add multiple categories to API
IBBoard <dev@ibboard.co.uk>
parents: 252
diff changeset
175 catUnitTypes.Add(unit.ID, unit);
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
176 }
11
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
177 }
8
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
178
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
179 private void BuildUnitTypesByCategoryCache()
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
180 {
11
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
181 if (unitTypesByCat == null)
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
182 {
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
183 DoBuildUnitTypesByCategoryCache();
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
184 }
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
185 }
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
186
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
187 private void DoBuildUnitTypesByCategoryCache()
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
188 {
8
613bc5eaac59 Re #9 - Make WarFoundry loading granular
IBBoard <dev@ibboard.co.uk>
parents: 0
diff changeset
189 unitTypesByCat = new Dictionary<Category,Dictionary<string,UnitType>>();
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
190
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
191 foreach (Category category in Categories)
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
192 {
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
193 unitTypesByCat.Add(category, new Dictionary<string, UnitType>());
11
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
194 }
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
195
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
196 foreach (UnitType unit in unitTypes.Values)
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
197 {
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
198 CacheUnitType(unit);
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
199 }
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
200 }
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
201
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
202 public UnitType GetUnitType(string id)
11
5a1df00b0359 Re #9 - Make WarFoundry API load files in small methods
IBBoard <dev@ibboard.co.uk>
parents: 8
diff changeset
203 {
118
d39de20f2ba1 Re #54: Add army loading support
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
204 EnsureFullyLoaded();
d39de20f2ba1 Re #54: Add army loading support
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
205 return DictionaryUtils.GetValue(unitTypes, id);
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
206 }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
207
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
208 public List<Ability> GetAbilityList()
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
209 {
118
d39de20f2ba1 Re #54: Add army loading support
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
210 EnsureFullyLoaded();
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
211 List<Ability> items = new List<Ability>();
55
9080366031c0 Re #9 - Refactor for small methods
IBBoard <dev@ibboard.co.uk>
parents: 54
diff changeset
212 items.AddRange(abilities.Values);
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
213 return items;
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
214 }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
215
47
85f2b9c3609c Re #13 - Use XPath for file loading
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
216 public void AddAbility(Ability newAbility)
85f2b9c3609c Re #13 - Use XPath for file loading
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
217 {
85f2b9c3609c Re #13 - Use XPath for file loading
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
218 //TODO: Throw DuplicateItemException
85f2b9c3609c Re #13 - Use XPath for file loading
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
219 abilities.Add(newAbility.ID, newAbility);
85f2b9c3609c Re #13 - Use XPath for file loading
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
220 }
85f2b9c3609c Re #13 - Use XPath for file loading
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
221
85f2b9c3609c Re #13 - Use XPath for file loading
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
222 [Obsolete("Use AddAbility method instead")]
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
223 public void SetAbilities(Dictionary<string, Ability> newAbilities)
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
224 {
47
85f2b9c3609c Re #13 - Use XPath for file loading
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
225 foreach (Ability ability in newAbilities.Values)
85f2b9c3609c Re #13 - Use XPath for file loading
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
226 {
85f2b9c3609c Re #13 - Use XPath for file loading
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
227 AddAbility(ability);
85f2b9c3609c Re #13 - Use XPath for file loading
IBBoard <dev@ibboard.co.uk>
parents: 15
diff changeset
228 }
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
229 }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
230
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
231 public Ability GetAbility(string id)
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
232 {
118
d39de20f2ba1 Re #54: Add army loading support
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
233 EnsureFullyLoaded();
d39de20f2ba1 Re #54: Add army loading support
IBBoard <dev@ibboard.co.uk>
parents: 104
diff changeset
234 return DictionaryUtils.GetValue(abilities, id);
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
235 }
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
236
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
237 protected virtual Dictionary<string, UnitType> RaceUnitTypes
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
238 {
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
239 get { return RaceRawUnitTypes; }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
240 set { RaceRawUnitTypes = value; }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
241 }
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
242
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
243 protected virtual Dictionary<string, EquipmentItem> RaceEquipment
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
244 {
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
245 get { return RaceRawEquipment; }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
246 set { RaceRawEquipment = value; }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
247 }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
248
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
249 protected virtual Dictionary<string, Ability> RaceAbilities
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
250 {
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
251 get { return RaceRawAbilities; }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
252 set { RaceRawAbilities = value; }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
253 }
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
254
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
255 protected Dictionary<string, UnitType> RaceRawUnitTypes
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
256 {
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
257 get { return unitTypes; }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
258 set { unitTypes = value; }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
259 }
82
3ea0ab04352b * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 55
diff changeset
260
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
261 protected Dictionary<string, EquipmentItem> RaceRawEquipment
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
262 {
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
263 get { return equipment; }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
264 set { equipment = value; }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
265 }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
266
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
267 protected Dictionary<string, Ability> RaceRawAbilities
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
268 {
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
269 get { return abilities; }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
270 set { abilities = value; }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
271 }
252
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
272
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
273 public void AddUnitMemberType(UnitMemberType memberType)
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
274 {
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
275 memberTypes[memberType.ID] = memberType;
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
276 }
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
277
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
278 /// <summary>
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
279 /// Gets a unit member type by its ID.
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
280 /// </summary>
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
281 /// <param name="id">
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
282 /// The ID of the unit member type to get
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
283 /// </param>
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
284 /// <returns>
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
285 /// The <code>UnitMemberType</code> with the specified ID, or null if one doesn't exist.
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
286 /// </returns>
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
287 public UnitMemberType GetUnitMemberType(string id)
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
288 {
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
289 EnsureFullyLoaded();
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
290 return DictionaryUtils.GetValue(memberTypes, id);
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
291 }
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
292
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
293 public UnitMemberType[] UnitMemberTypes
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
294 {
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
295 get
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
296 {
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
297 EnsureFullyLoaded();
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
298 return DictionaryUtils.ToArray(memberTypes);
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
299 }
a54da5a8b5bb Re #268: Restructure stats for re-use
IBBoard <dev@ibboard.co.uk>
parents: 118
diff changeset
300 }
0
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
301 }
520818033bb6 Initial commit of WarFoundry code
IBBoard <dev@ibboard.co.uk>
parents:
diff changeset
302 }