0
|
1 // IWarFoundryFactory.cs
|
|
2 //
|
|
3 // Copyright (C) 2008 IBBoard
|
|
4 //
|
|
5 // This library is free software; you can redistribute it and/or
|
|
6 // modify it under the terms of the GNU Lesser General Public
|
|
7 // License as published by the Free Software Foundation; either
|
|
8 // version 2.1 of the License, or (at your option) any later version.
|
|
9 //
|
|
10 // This library is distributed in the hope that it will be useful,
|
|
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
13 // Lesser General Public License for more details.
|
|
14 //
|
|
15 // You should have received a copy of the GNU Lesser General Public
|
|
16 // License along with this library; if not, write to the Free Software
|
|
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
18 //
|
|
19 //
|
|
20
|
|
21 using System;
|
|
22 using System.IO;
|
|
23 using System.Collections.Generic;
|
|
24 using IBBoard.WarFoundry.API.Objects;
|
|
25
|
|
26 namespace IBBoard.WarFoundry.API.Factories
|
|
27 {
|
|
28 public interface IWarFoundryFactory
|
|
29 {
|
|
30 /// <summary>
|
|
31 /// 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.
|
|
32 /// </summary>
|
|
33 /// <param name="file">
|
|
34 /// A <see cref="FileInfo"/> for the file to check support for.
|
|
35 /// </param>
|
|
36 /// <returns>
|
|
37 /// <code>true</code> if the file appears to be supported for loading by this factory, else returns <code>false</code>
|
|
38 /// </returns>
|
|
39 bool CanHandleFileFormat(FileInfo file);
|
|
40
|
|
41 /// <summary>
|
|
42 /// Reads the data from the supplied file and returns it as a collection of loadable objects.
|
|
43 /// </summary>
|
|
44 /// <param name="file">
|
|
45 /// A <see cref="FileInfo"/> for the file to load data from
|
|
46 /// </param>
|
|
47 /// <returns>
|
|
48 /// A <see cref="ICollection`1"/> of <see cref="IWarFoundryObject"/>s that were loaded from the file
|
|
49 /// </returns>
|
|
50 ICollection<IWarFoundryObject> CreateObjectsFromFile(FileInfo file);
|
|
51 }
|
|
52 }
|