Mercurial > repos > snowblizz-super-API-ideas
comparison API/Factories/IWarFoundryFactory.cs @ 337:3c4a6403a88c
* Fix capitalisation so that new files are in the namespace
no-open-ticket
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 03 Apr 2011 18:50:32 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
336:3631c1493c7f | 337:3c4a6403a88c |
---|---|
1 // This file (IWarFoundryFactory.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2007, 2008, 2009 IBBoard. | |
2 // | |
3 // 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. | |
4 | |
5 using System; | |
6 using System.IO; | |
7 using System.Collections.Generic; | |
8 using IBBoard.WarFoundry.API.Objects; | |
9 | |
10 namespace IBBoard.WarFoundry.API.Factories | |
11 { | |
12 public interface IWarFoundryFactory | |
13 { | |
14 event SingleArgMethodInvoker<GameSystem> GameSystemLoaded; | |
15 | |
16 event SingleArgMethodInvoker<Race> RaceLoaded; | |
17 | |
18 event SingleArgMethodInvoker<Army> ArmyLoaded; | |
19 | |
20 /// <summary> | |
21 /// Completes the loading of an object if it is loaded in stages. | |
22 /// </summary> | |
23 /// <param name="obj"> | |
24 /// The <see cref="IWarFoundryStagedLoadObject"/> that should be fully loaded. | |
25 /// </param> | |
26 void CompleteLoading(IWarFoundryStagedLoadObject obj); | |
27 | |
28 /// <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 /// </summary> | |
31 /// <param name="file"> | |
32 /// A <see cref="FileInfo"/> for the file to check support for. | |
33 /// </param> | |
34 /// <returns> | |
35 /// <code>true</code> if the file appears to be supported for loading by this factory, else returns <code>false</code> | |
36 /// </returns> | |
37 bool CanHandleFileFormat(FileInfo file); | |
38 | |
39 /// <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 /// </summary> | |
42 /// <param name="file"> | |
43 /// A <see cref="FileInfo"/> for the file to check support for as a file containing Race information. | |
44 /// </param> | |
45 /// <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 /// </returns> | |
48 bool CanHandleFileAsRace(FileInfo file); | |
49 | |
50 /// <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 /// </summary> | |
53 /// <param name="file"> | |
54 /// A <see cref="FileInfo"/> for the file to check support for as a file containing GameSystem information. | |
55 /// </param> | |
56 /// <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 /// </returns> | |
59 bool CanHandleFileAsGameSystem(FileInfo file); | |
60 | |
61 /// <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 /// </summary> | |
64 /// <param name="file"> | |
65 /// A <see cref="FileInfo"/> for the file to check support for as a file containing Army information. | |
66 /// </param> | |
67 /// <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 /// </returns> | |
70 bool CanHandleFileAsArmy(FileInfo file); | |
71 | |
72 /// <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 /// for each object loaded for asynchronous use. | |
75 /// | |
76 /// May throw a <see cref=" IBBoard.IO.InvalidFileException"/> if the file is supported by the Factory but the content is invalid. | |
77 /// </summary> | |
78 /// <param name="file"> | |
79 /// A <see cref="FileInfo"/> for the file to load data from | |
80 /// </param> | |
81 /// <returns> | |
82 /// A <see cref="ICollection`1"/> of <see cref="IWarFoundryObject"/>s that were loaded from the file | |
83 /// </returns> | |
84 ICollection<IWarFoundryObject> CreateObjectsFromFile(FileInfo file); | |
85 } | |
86 } |