Mercurial > repos > IBBoard.WarFoundry.API.Tests
comparison API/Factories/Mock/MockSystemFactory.cs @ 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 | a4e7e938d065 |
children |
comparison
equal
deleted
inserted
replaced
87:5c04db41d643 | 88:31fd34f7d7cf |
---|---|
5 using System; | 5 using System; |
6 using System.IO; | 6 using System.IO; |
7 using IBBoard.WarFoundry.API.Factories; | 7 using IBBoard.WarFoundry.API.Factories; |
8 using IBBoard.WarFoundry.API.Objects; | 8 using IBBoard.WarFoundry.API.Objects; |
9 using ICSharpCode.SharpZipLib.Zip; | 9 using ICSharpCode.SharpZipLib.Zip; |
10 using System.Collections.Generic; | |
10 | 11 |
11 namespace IBBoard.WarFoundry.API.Factories.Mock | 12 namespace IBBoard.WarFoundry.API.Factories.Mock |
12 { | 13 { |
13 public class MockSystemFactory : AbstractNativeWarFoundryFactory | 14 public class MockSystemFactory : AbstractNativeWarFoundryFactory |
14 { | 15 { |
56 protected override Race CreateRaceFromStream (ZipFile file, Stream dataStream) | 57 protected override Race CreateRaceFromStream (ZipFile file, Stream dataStream) |
57 { | 58 { |
58 throw new NotImplementedException (); | 59 throw new NotImplementedException (); |
59 } | 60 } |
60 | 61 |
61 protected override Stream GetArmyDataStream (ZipFile file) | 62 protected override ICollection<ZipEntry> GetArmyZipEntries(ZipFile file) |
62 { | 63 { |
63 throw new NotImplementedException (); | 64 throw new NotImplementedException (); |
64 } | 65 } |
65 | 66 |
66 protected override Stream GetGameSystemDataStream (ZipFile file) | 67 protected override ICollection<ZipEntry> GetGameSystemZipEntries (ZipFile file) |
67 { | 68 { |
68 return new MemoryStream(); | 69 List<ZipEntry> entries = new List<ZipEntry>(); |
70 ZipEntry zipEntry = file.GetEntry("data.systemx"); | |
71 if (zipEntry != null) | |
72 { | |
73 entries.Add(zipEntry); | |
74 } | |
75 return entries; | |
69 } | 76 } |
70 | 77 |
71 protected override Stream GetRaceDataStream (ZipFile file) | 78 protected override ICollection<ZipEntry> GetRaceZipEntries (ZipFile file) |
72 { | 79 { |
73 throw new NotImplementedException (); | 80 throw new NotImplementedException (); |
74 } | 81 } |
75 } | 82 } |
76 } | 83 } |