Mercurial > repos > IBDev-IBBoard.WarFoundry.API
view API/WarFoundryHacks.cs @ 485:8160d1f8243c
Re #418: Build WarFoundry for Android PoC
* Make Mono for Android version of .csproj file
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 14 Jul 2012 15:26:46 +0100 |
parents | 4d6c92744254 |
children | e35fc85eda2b |
line wrap: on
line source
// This file (WarFoundryHacks.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2011 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.IO; using IBBoard; using IBBoard.WarFoundry.API.Factories.Requirement; using IBBoard.WarFoundry.API.Factories.Xml; using IBBoard.WarFoundry.API.Savers; using IBBoard.WarFoundry.API.Savers.Xml; using IBBoard.WarFoundry.API.Loading; using System.Reflection; namespace IBBoard.WarFoundry.API { /// <summary> /// A collection of hacks and work-arounds to make things work correctly. /// </summary> public class WarFoundryHacks { public static void Initialise() { //Load embedded files from resource Assembly assm = Assembly.GetExecutingAssembly(); LoadableObjectSourceResourceSet resSet = new LoadableObjectSourceResourceSet(assm, "IBBoard.WarFoundry.data.Empire.race", "IBBoard.WarFoundry.data.SampleSystem.system"); WarFoundryLoader.GetDefault().AddLoadSource(resSet); //Make sure we have at least one loader - should be controlled by plugins WarFoundryLoader.GetDefault().RegisterFactory(WarFoundryXmlFactory.GetFactory()); //Make sure we have a way to save files - should be controlled by plugins WarFoundrySaver.SetFileSaver(new WarFoundryXmlFileSaver()); //Make sure we have the requirement factories - should be controlled by plugins WarFoundryLoader.RegisterRequirementFactory(new UnitRequiresAtLeastNUnitsRequirementFactory()); WarFoundryLoader.RegisterRequirementFactory(new UnitRequiresNoMoreThanNOfUnitTypeRequirementFactory()); WarFoundryLoader.RegisterRequirementFactory(new UnitRequiresNUnitsForMUnitsRequirementFactory()); } } }