Mercurial > repos > IBDev-IBBoard.WarFoundry.API
annotate API/WarFoundryHacks.cs @ 470:426b8c5e283c
Re #359: Add "only contained" attribute to unit types
* Update example army to use "only contained" attribute on champions
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 14 Apr 2012 20:44:22 +0100 |
parents | ba6c762cdfc3 |
children | 81e130f3b85e |
rev | line source |
---|---|
435 | 1 // This file (WarFoundryHacks.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2011 IBBoard |
2 // | |
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. | |
4 using System; | |
5 using System.IO; | |
6 using IBBoard; | |
7 using IBBoard.WarFoundry.API.Factories.Requirement; | |
8 using IBBoard.WarFoundry.API.Factories.Xml; | |
9 using IBBoard.WarFoundry.API.Savers; | |
10 using IBBoard.WarFoundry.API.Savers.Xml; | |
11 | |
12 namespace IBBoard.WarFoundry.API | |
13 { | |
14 /// <summary> | |
15 /// A collection of hacks and work-arounds to make things work correctly. | |
16 /// </summary> | |
17 public class WarFoundryHacks | |
18 { | |
19 public static void Initialise() | |
20 { | |
21 //Set default data path - should be a preference | |
22 WarFoundryLoader.GetDefault().AddLoadDirectory(new DirectoryInfo(Path.Combine(Constants.ExecutablePath, "data"))); | |
23 //Make sure we have at least one loader - should be controlled by plugins | |
24 WarFoundryLoader.GetDefault().RegisterFactory(WarFoundryXmlFactory.GetFactory()); | |
25 //Make sure we have a way to save files - should be controlled by plugins | |
26 WarFoundrySaver.SetFileSaver(new WarFoundryXmlFileSaver()); | |
27 //Make sure we have the requirement factories - should be controlled by plugins | |
28 WarFoundryLoader.RegisterRequirementFactory(new UnitRequiresAtLeastNUnitsRequirementFactory()); | |
29 WarFoundryLoader.RegisterRequirementFactory(new UnitRequiresNoMoreThanNOfUnitTypeRequirementFactory()); | |
449
ba6c762cdfc3
* Add missing line to Hacks class to add third factory
IBBoard <dev@ibboard.co.uk>
parents:
435
diff
changeset
|
30 WarFoundryLoader.RegisterRequirementFactory(new UnitRequiresNUnitsForMUnitsRequirementFactory()); |
435 | 31 } |
32 } | |
33 } | |
34 |