changeset 88:31fd34f7d7cf

Re #253: Allow multiple data files in a single zip * Update Mock factory to work properly
author IBBoard <dev@ibboard.co.uk>
date Sat, 26 Feb 2011 20:15:38 +0000
parents 5c04db41d643
children 90dee8d781ee
files API/Factories/Mock/MockSystemFactory.cs
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/API/Factories/Mock/MockSystemFactory.cs	Sat Feb 26 20:14:29 2011 +0000
     1.2 +++ b/API/Factories/Mock/MockSystemFactory.cs	Sat Feb 26 20:15:38 2011 +0000
     1.3 @@ -7,6 +7,7 @@
     1.4  using IBBoard.WarFoundry.API.Factories;
     1.5  using IBBoard.WarFoundry.API.Objects;
     1.6  using ICSharpCode.SharpZipLib.Zip;
     1.7 +using System.Collections.Generic;
     1.8  
     1.9  namespace IBBoard.WarFoundry.API.Factories.Mock
    1.10  {
    1.11 @@ -58,17 +59,23 @@
    1.12  			throw new NotImplementedException ();
    1.13  		}
    1.14  		
    1.15 -		protected override Stream GetArmyDataStream (ZipFile file)
    1.16 +		protected override ICollection<ZipEntry> GetArmyZipEntries(ZipFile file)
    1.17  		{
    1.18  			throw new NotImplementedException ();
    1.19  		}
    1.20  		
    1.21 -		protected override Stream GetGameSystemDataStream (ZipFile file)
    1.22 +		protected override ICollection<ZipEntry> GetGameSystemZipEntries (ZipFile file)
    1.23  		{
    1.24 -			return new MemoryStream();
    1.25 +			List<ZipEntry> entries = new List<ZipEntry>();
    1.26 +			ZipEntry zipEntry = file.GetEntry("data.systemx");
    1.27 +			if (zipEntry != null)
    1.28 +			{
    1.29 +				entries.Add(zipEntry);
    1.30 +			}
    1.31 +			return entries;
    1.32  		}
    1.33  
    1.34 -		protected override Stream GetRaceDataStream (ZipFile file)
    1.35 +		protected override ICollection<ZipEntry> GetRaceZipEntries (ZipFile file)
    1.36  		{
    1.37  			throw new NotImplementedException ();
    1.38  		}