Utilities used to handle different map formats, including loading, parsing, and saving.
More...
|
| static void | RegisterConverter (IMapConverter converter) |
| | Registers a new map importer or exporter. Only one importer/exporter may be registered for each supported format. If an importer/exporter for the given format has already been registered, it will be replaced.
|
| |
| static MapFormat | Identify ([NotNull] string path, bool tryFallbackConverters) |
| | Identifies the map format from the specified file name.
|
| |
| static bool | TryLoadHeader ([NotNull] string fileName, out Map map) |
| | Attempts to load the map excluding the block data from it's header using the specified file name.
|
| |
| static Map | LoadHeader ([NotNull] string fileName) |
| | Loads the map excluding block data from it's header using the specified file name.
|
| |
| static bool | TryLoad ([NotNull] string fileName, out Map map) |
| | Attempts to load the map including the block data from it's header using the specified file name.
|
| |
| static Map | Load ([NotNull] string fileName) |
| | Loads the map from it's header using the specified file name.
|
| |
| static bool | TrySave ([NotNull] Map mapToSave,[NotNull] string fileName, MapFormat mapFormat) |
| | Attempts to save the map, under the specified file name using the specified format.
|
| |
| static void | Save ([NotNull] Map mapToSave,[NotNull] string fileName, MapFormat mapFormat) |
| | Save the map, under the specified file name using the specified format.
|
| |
| static IMapImporter | GetImporter (MapFormat format) |
| | Looks up an appropriate importer for the given MapFormat.
|
| |
| static IMapExporter | GetExporter (MapFormat format) |
| | Looks up an appropriate exporter for the given MapFormat.
|
| |
| static IMapImporter[] | GetImporters () |
| | Returns an array of all available map importers.
|
| |
| static IMapExporter[] | GetExporters () |
| | Returns an array of all available map exporters.
|
| |
Utilities used to handle different map formats, including loading, parsing, and saving.
Looks up an appropriate exporter for the given MapFormat.
- Parameters
-
| format | Map format for which an exporter should be looked up. |
- Returns
- IMapExporter object if an exporter was found for the given format; otherwise null.
| static IMapExporter [] fCraft.MapConversion.MapUtility.GetExporters |
( |
| ) |
|
|
static |
Returns an array of all available map exporters.
Looks up an appropriate importer for the given MapFormat.
- Parameters
-
| format | Map format for which an importer should be looked up. |
- Returns
- IMapImporter object if an importer was found for the given format; otherwise null.
| static IMapImporter [] fCraft.MapConversion.MapUtility.GetImporters |
( |
| ) |
|
|
static |
Returns an array of all available map importers.
| static MapFormat fCraft.MapConversion.MapUtility.Identify |
( |
[NotNull] string |
path, |
|
|
bool |
tryFallbackConverters |
|
) |
| |
|
static |
Identifies the map format from the specified file name.
- Parameters
-
| path | Path to the file or directory to be identified. |
| tryFallbackConverters | Whether or this method should try ALL converters, including ones that do not typically handle files with the given file extension. |
- Returns
- Map format of the specified file. MapFormat.Unknown, if the format could not be identified.
- Exceptions
-
| ArgumentNullException | fileName is null. |
| FileNotFoundException | The file specified in path was not found. |
| static Map fCraft.MapConversion.MapUtility.Load |
( |
[NotNull] string |
fileName | ) |
|
|
static |
Loads the map from it's header using the specified file name.
- Parameters
-
| fileName | The name of the file. |
- Returns
- The loaded map excluding block data.
- Exceptions
-
| ArgumentNullException | fileName is null. |
| FileNotFoundException | File/directory with the given name is missing. |
| NoMapConverterFoundException | No converter can be found to load the given map file. |
| static Map fCraft.MapConversion.MapUtility.LoadHeader |
( |
[NotNull] string |
fileName | ) |
|
|
static |
Loads the map excluding block data from it's header using the specified file name.
- Parameters
-
| fileName | The name of the file. |
- Returns
- The loaded map excluding block data.
- Exceptions
-
| ArgumentNullException | fileName is null. |
| FileNotFoundException | File/directory with the given name is missing. |
| NoMapConverterFoundException | No converter can be found to load the map. |
| static void fCraft.MapConversion.MapUtility.RegisterConverter |
( |
IMapConverter |
converter | ) |
|
|
static |
Registers a new map importer or exporter. Only one importer/exporter may be registered for each supported format. If an importer/exporter for the given format has already been registered, it will be replaced.
- Parameters
-
| converter | New converter to add. |
- Exceptions
-
| static void fCraft.MapConversion.MapUtility.Save |
( |
[NotNull] Map |
mapToSave, |
|
|
[NotNull] string |
fileName, |
|
|
MapFormat |
mapFormat |
|
) |
| |
|
static |
Save the map, under the specified file name using the specified format.
- Parameters
-
| mapToSave | Map file to be saved. |
| fileName | The name of the file to save to. |
| mapFormat | The format to use when saving the map. |
- Exceptions
-
| ArgumentNullException | mapToSave or fileName are null. |
| ArgumentException | mapFormat is set to MapFormat.Unknown. |
| NoMapConverterFoundException | No exporter could be found for the given format. |
| Exception | Other kinds of exceptions may be thrown by the map exporter. |
| static bool fCraft.MapConversion.MapUtility.TryLoad |
( |
[NotNull] string |
fileName, |
|
|
out Map |
map |
|
) |
| |
|
static |
Attempts to load the map including the block data from it's header using the specified file name.
- Parameters
-
| fileName | The name of the file. |
| map | Where the loaded map should be stored. |
- Returns
- Whether or not the map was loaded successfully.
- Exceptions
-
| ArgumentNullException | fileName is null. |
| static bool fCraft.MapConversion.MapUtility.TryLoadHeader |
( |
[NotNull] string |
fileName, |
|
|
out Map |
map |
|
) |
| |
|
static |
Attempts to load the map excluding the block data from it's header using the specified file name.
- Parameters
-
| fileName | The name of the file. |
| map | Where the loaded map should be stored. |
- Returns
- Whether or not the map excluding block data was loaded successfully.
- Exceptions
-
| ArgumentNullException | fileName is null. |
| static bool fCraft.MapConversion.MapUtility.TrySave |
( |
[NotNull] Map |
mapToSave, |
|
|
[NotNull] string |
fileName, |
|
|
MapFormat |
mapFormat |
|
) |
| |
|
static |
Attempts to save the map, under the specified file name using the specified format.
- Parameters
-
| mapToSave | Map file to be saved. |
| fileName | The name of the file to save to. |
| mapFormat | The format to use when saving the map. |
- Returns
- Whether or not the map save completed successfully.
- Exceptions
-
| ArgumentNullException | mapToSave or fileName are null. |
| ArgumentException | mapFormat is set to MapFormat.Unknown. |
| NoMapConverterFoundException | No exporter could be found for the given format. |
The documentation for this class was generated from the following file: