changeset 293:a1657c6f41a0

Re #319: WarFoundry Forge - No Factory set failure * Add a dummy factory for use by the Forge app
author IBBoard <dev@ibboard.co.uk>
date Fri, 17 Dec 2010 20:09:06 +0000
parents 4dcb038e4f55
children 52985d48b263
files IBBoard.WarFoundry.API.csproj api/Factories/DummyWarFoundryFactory.cs
diffstat 2 files changed, 50 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/IBBoard.WarFoundry.API.csproj	Thu Dec 16 23:03:50 2010 +0000
     1.2 +++ b/IBBoard.WarFoundry.API.csproj	Fri Dec 17 20:09:06 2010 +0000
     1.3 @@ -1,4 +1,4 @@
     1.4 -<?xml version="1.0" encoding="utf-8"?>
     1.5 +<?xml version="1.0" encoding="utf-8"?>
     1.6  <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
     1.7    <PropertyGroup>
     1.8      <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     1.9 @@ -180,6 +180,7 @@
    1.10      <Compile Include="api\DefaultWarFoundryLoader.cs" />
    1.11      <Compile Include="api\Objects\UnitMemberType.cs" />
    1.12      <Compile Include="api\Factories\Xml\WarFoundryXmlLimitParser.cs" />
    1.13 +    <Compile Include="api\Factories\DummyWarFoundryFactory.cs" />
    1.14    </ItemGroup>
    1.15    <ItemGroup>
    1.16      <Reference Include="System.Xml" />
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/api/Factories/DummyWarFoundryFactory.cs	Fri Dec 17 20:09:06 2010 +0000
     2.3 @@ -0,0 +1,48 @@
     2.4 +//  This file (DummyWarFoundryFactory.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2010 IBBoard
     2.5 +// 
     2.6 +//  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.
     2.7 +
     2.8 +using IBBoard.WarFoundry.API.Factories;
     2.9 +using IBBoard.WarFoundry.API.Objects;
    2.10 +using System.IO;
    2.11 +using System.Collections.Generic;
    2.12 +
    2.13 +namespace IBBoard.WarFoundry.API.Factories
    2.14 +{
    2.15 +	///<summary>
    2.16 +	///A dummy factory for use with <see cref="WarFoundryStagedLoadingObject"/>s that implements the bare minimum of the methods but won't load anything
    2.17 +	///</summary>
    2.18 +	public class DummyWarFoundryFactory : IWarFoundryFactory
    2.19 +	{
    2.20 +		public void CompleteLoading(IWarFoundryStagedLoadObject obj)
    2.21 +		{
    2.22 +			obj.SetAsFullyLoaded();
    2.23 +		}
    2.24 +
    2.25 +		public bool CanHandleFileFormat(FileInfo file)
    2.26 +		{
    2.27 +			return false;
    2.28 +		}
    2.29 +
    2.30 +		public bool CanHandleFileAsRace(FileInfo file)
    2.31 +		{
    2.32 +			return false;
    2.33 +		}
    2.34 +
    2.35 +		public bool CanHandleFileAsGameSystem(FileInfo file)
    2.36 +		{
    2.37 +			return false;
    2.38 +		}
    2.39 +
    2.40 +		public bool CanHandleFileAsArmy(FileInfo file)
    2.41 +		{
    2.42 +			return false;
    2.43 +		}
    2.44 +
    2.45 +		public ICollection<IWarFoundryObject> CreateObjectsFromFile(FileInfo file)
    2.46 +		{
    2.47 +			return new List<IWarFoundryObject>();
    2.48 +		}
    2.49 +	}
    2.50 +}
    2.51 +