Mercurial > repos > IBDev-IBBoard.WarFoundry.API
comparison API/Factories/IWarFoundryFactory.cs @ 482:1ed2f3ab5e35
Re #419: Remove assumptions of a file-based install
* Swap API to using new "loadable object" and "loadable object source" wrappers to allow file-based or memory-based loading
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 07 Jul 2012 21:01:32 +0100 |
parents | 3c4a6403a88c |
children |
comparison
equal
deleted
inserted
replaced
481:81f32062c9fa | 482:1ed2f3ab5e35 |
---|---|
4 | 4 |
5 using System; | 5 using System; |
6 using System.IO; | 6 using System.IO; |
7 using System.Collections.Generic; | 7 using System.Collections.Generic; |
8 using IBBoard.WarFoundry.API.Objects; | 8 using IBBoard.WarFoundry.API.Objects; |
9 using IBBoard.WarFoundry.API.Loading; | |
9 | 10 |
10 namespace IBBoard.WarFoundry.API.Factories | 11 namespace IBBoard.WarFoundry.API.Factories |
11 { | 12 { |
12 public interface IWarFoundryFactory | 13 public interface IWarFoundryFactory |
13 { | 14 { |
27 | 28 |
28 /// <summary> | 29 /// <summary> |
29 /// Checks if the factory thinks it can handle the supplied file. Checks can be performed on file extension or some basic check of file content, or some other method. | 30 /// Checks if the factory thinks it can handle the supplied file. Checks can be performed on file extension or some basic check of file content, or some other method. |
30 /// </summary> | 31 /// </summary> |
31 /// <param name="file"> | 32 /// <param name="file"> |
32 /// A <see cref="FileInfo"/> for the file to check support for. | 33 /// A <see cref="ILoadableObject"/> for the file to check support for. |
33 /// </param> | 34 /// </param> |
34 /// <returns> | 35 /// <returns> |
35 /// <code>true</code> if the file appears to be supported for loading by this factory, else returns <code>false</code> | 36 /// <code>true</code> if the file appears to be supported for loading by this factory, else returns <code>false</code> |
36 /// </returns> | 37 /// </returns> |
37 bool CanHandleFileFormat(FileInfo file); | 38 bool CanHandleFileFormat(ILoadableObject file); |
38 | 39 |
39 /// <summary> | 40 /// <summary> |
40 /// Checks if the factory thinks it can handle the supplied file as a Race. Checks can be performed on file extension or some basic check of file content, or some other method. | 41 /// Checks if the factory thinks it can handle the supplied file as a Race. Checks can be performed on file extension or some basic check of file content, or some other method. |
41 /// </summary> | 42 /// </summary> |
42 /// <param name="file"> | 43 /// <param name="file"> |
43 /// A <see cref="FileInfo"/> for the file to check support for as a file containing Race information. | 44 /// A <see cref="ILoadableObject"/> for the file to check support for as a file containing Race information. |
44 /// </param> | 45 /// </param> |
45 /// <returns> | 46 /// <returns> |
46 /// <code>true</code> if the file appears to be supported for loading by this factory as a Race, else returns <code>false</code> | 47 /// <code>true</code> if the file appears to be supported for loading by this factory as a Race, else returns <code>false</code> |
47 /// </returns> | 48 /// </returns> |
48 bool CanHandleFileAsRace(FileInfo file); | 49 bool CanHandleFileAsRace(ILoadableObject file); |
49 | 50 |
50 /// <summary> | 51 /// <summary> |
51 /// Checks if the factory thinks it can handle the supplied file as a GameSystem. Checks can be performed on file extension or some basic check of file content, or some other method. | 52 /// Checks if the factory thinks it can handle the supplied file as a GameSystem. Checks can be performed on file extension or some basic check of file content, or some other method. |
52 /// </summary> | 53 /// </summary> |
53 /// <param name="file"> | 54 /// <param name="file"> |
54 /// A <see cref="FileInfo"/> for the file to check support for as a file containing GameSystem information. | 55 /// A <see cref="ILoadableObject"/> for the file to check support for as a file containing GameSystem information. |
55 /// </param> | 56 /// </param> |
56 /// <returns> | 57 /// <returns> |
57 /// <code>true</code> if the file appears to be supported for loading by this factory as a GameSystem, else returns <code>false</code> | 58 /// <code>true</code> if the file appears to be supported for loading by this factory as a GameSystem, else returns <code>false</code> |
58 /// </returns> | 59 /// </returns> |
59 bool CanHandleFileAsGameSystem(FileInfo file); | 60 bool CanHandleFileAsGameSystem(ILoadableObject file); |
60 | 61 |
61 /// <summary> | 62 /// <summary> |
62 /// Checks if the factory thinks it can handle the supplied file as a Army. Checks can be performed on file extension or some basic check of file content, or some other method. | 63 /// Checks if the factory thinks it can handle the supplied file as a Army. Checks can be performed on file extension or some basic check of file content, or some other method. |
63 /// </summary> | 64 /// </summary> |
64 /// <param name="file"> | 65 /// <param name="file"> |
65 /// A <see cref="FileInfo"/> for the file to check support for as a file containing Army information. | 66 /// A <see cref="ILoadableObject"/> for the file to check support for as a file containing Army information. |
66 /// </param> | 67 /// </param> |
67 /// <returns> | 68 /// <returns> |
68 /// <code>true</code> if the file appears to be supported for loading by this factory as a Army, else returns <code>false</code> | 69 /// <code>true</code> if the file appears to be supported for loading by this factory as a Army, else returns <code>false</code> |
69 /// </returns> | 70 /// </returns> |
70 bool CanHandleFileAsArmy(FileInfo file); | 71 bool CanHandleFileAsArmy(ILoadableObject file); |
71 | 72 |
72 /// <summary> | 73 /// <summary> |
73 /// Reads the data from the supplied file and returns it as a collection of loadable objects. In addition, it fires the appropriate XxxLoaded event | 74 /// Reads the data from the supplied file and returns it as a collection of loadable objects. In addition, it fires the appropriate XxxLoaded event |
74 /// for each object loaded for asynchronous use. | 75 /// for each object loaded for asynchronous use. |
75 /// | 76 /// |
76 /// May throw a <see cref=" IBBoard.IO.InvalidFileException"/> if the file is supported by the Factory but the content is invalid. | 77 /// May throw a <see cref=" IBBoard.IO.InvalidFileException"/> if the file is supported by the Factory but the content is invalid. |
77 /// </summary> | 78 /// </summary> |
78 /// <param name="file"> | 79 /// <param name="file"> |
79 /// A <see cref="FileInfo"/> for the file to load data from | 80 /// A <see cref="ILoadableObject"/> for the file to load data from |
80 /// </param> | 81 /// </param> |
81 /// <returns> | 82 /// <returns> |
82 /// A <see cref="ICollection`1"/> of <see cref="IWarFoundryObject"/>s that were loaded from the file | 83 /// A <see cref="ICollection`1"/> of <see cref="IWarFoundryObject"/>s that were loaded from the file |
83 /// </returns> | 84 /// </returns> |
84 ICollection<IWarFoundryObject> CreateObjectsFromFile(FileInfo file); | 85 ICollection<IWarFoundryObject> CreateObjectsFromFile(ILoadableObject file); |
85 } | 86 } |
86 } | 87 } |