# HG changeset patch # User IBBoard # Date 1292616546 0 # Node ID a1657c6f41a04d6181d399f21eb2e50e4edfdef8 # Parent 4dcb038e4f5543d4c1f60c2927b9dc66d1efd048 Re #319: WarFoundry Forge - No Factory set failure * Add a dummy factory for use by the Forge app diff -r 4dcb038e4f55 -r a1657c6f41a0 IBBoard.WarFoundry.API.csproj --- a/IBBoard.WarFoundry.API.csproj Thu Dec 16 23:03:50 2010 +0000 +++ b/IBBoard.WarFoundry.API.csproj Fri Dec 17 20:09:06 2010 +0000 @@ -1,4 +1,4 @@ - + Debug @@ -180,6 +180,7 @@ + diff -r 4dcb038e4f55 -r a1657c6f41a0 api/Factories/DummyWarFoundryFactory.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/api/Factories/DummyWarFoundryFactory.cs Fri Dec 17 20:09:06 2010 +0000 @@ -0,0 +1,48 @@ +// This file (DummyWarFoundryFactory.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2010 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 IBBoard.WarFoundry.API.Factories; +using IBBoard.WarFoundry.API.Objects; +using System.IO; +using System.Collections.Generic; + +namespace IBBoard.WarFoundry.API.Factories +{ + /// + ///A dummy factory for use with s that implements the bare minimum of the methods but won't load anything + /// + public class DummyWarFoundryFactory : IWarFoundryFactory + { + public void CompleteLoading(IWarFoundryStagedLoadObject obj) + { + obj.SetAsFullyLoaded(); + } + + public bool CanHandleFileFormat(FileInfo file) + { + return false; + } + + public bool CanHandleFileAsRace(FileInfo file) + { + return false; + } + + public bool CanHandleFileAsGameSystem(FileInfo file) + { + return false; + } + + public bool CanHandleFileAsArmy(FileInfo file) + { + return false; + } + + public ICollection CreateObjectsFromFile(FileInfo file) + { + return new List(); + } + } +} +