Mercurial > repos > IBDev-IBBoard.WarFoundry.API
annotate api/WarFoundryLoader.cs @ 252:a54da5a8b5bb
Re #268: Restructure stats for re-use
* Add "Member Type" class
* Add member type setting and getting to Race
* Load member types from XML files
* Make unit type pull stat line from stats or first member type, or fall back to a blank stat line
* Change Stats object to initialise blank values
* Change schema
* Make stats optional
* Add member type list to race
* Add optional member type references to units
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 25 Apr 2010 15:07:08 +0000 |
parents | a36a0e9cc05d |
children |
rev | line source |
---|---|
104
2f3cafb69799
Re #121: Migrate to AGPL license
IBBoard <dev@ibboard.co.uk>
parents:
102
diff
changeset
|
1 // This file (WarFoundryLoader.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2007, 2008, 2009 IBBoard. |
0 | 2 // |
104
2f3cafb69799
Re #121: Migrate to AGPL license
IBBoard <dev@ibboard.co.uk>
parents:
102
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 | 4 |
5 using System; | |
6 using ICSharpCode.SharpZipLib.Zip; | |
7 | |
8 namespace IBBoard.WarFoundry.API | |
9 { | |
10 public class WarFoundryLoader | |
11 { | |
233
a36a0e9cc05d
Re #228: Crash with missing abilityID
IBBoard <dev@ibboard.co.uk>
parents:
226
diff
changeset
|
12 private static AbstractWarFoundryLoader loader; |
0 | 13 |
14 /// <summary> | |
15 /// Gets the default <see cref="WarFoundryLoader"/> used to load WarFoundry data files. | |
16 /// </summary> | |
17 /// <returns> | |
18 /// The default <see cref="WarFoundryLoader"/> | |
19 /// </returns> | |
233
a36a0e9cc05d
Re #228: Crash with missing abilityID
IBBoard <dev@ibboard.co.uk>
parents:
226
diff
changeset
|
20 public static AbstractWarFoundryLoader GetDefault() |
0 | 21 { |
22 if (loader == null) | |
23 { | |
233
a36a0e9cc05d
Re #228: Crash with missing abilityID
IBBoard <dev@ibboard.co.uk>
parents:
226
diff
changeset
|
24 loader = new DefaultWarFoundryLoader(); |
0 | 25 } |
26 | |
27 return loader; | |
28 } | |
29 | |
233
a36a0e9cc05d
Re #228: Crash with missing abilityID
IBBoard <dev@ibboard.co.uk>
parents:
226
diff
changeset
|
30 public static void SetDefault(AbstractWarFoundryLoader newLoader) |
a36a0e9cc05d
Re #228: Crash with missing abilityID
IBBoard <dev@ibboard.co.uk>
parents:
226
diff
changeset
|
31 { |
a36a0e9cc05d
Re #228: Crash with missing abilityID
IBBoard <dev@ibboard.co.uk>
parents:
226
diff
changeset
|
32 loader = newLoader; |
a36a0e9cc05d
Re #228: Crash with missing abilityID
IBBoard <dev@ibboard.co.uk>
parents:
226
diff
changeset
|
33 } |
0 | 34 |
144
721891008b5c
Fixes #22: Add functionality to get failed file loads and reason
IBBoard <dev@ibboard.co.uk>
parents:
141
diff
changeset
|
35 private WarFoundryLoader() |
0 | 36 { |
233
a36a0e9cc05d
Re #228: Crash with missing abilityID
IBBoard <dev@ibboard.co.uk>
parents:
226
diff
changeset
|
37 //Hide constructor |
0 | 38 } |
39 } | |
40 } |