Skip to content

Commit

Permalink
Document new IFileSystem overloads
Browse files Browse the repository at this point in the history
  • Loading branch information
sk-zk committed Nov 1, 2024
1 parent 387737a commit 47d99fb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
11 changes: 11 additions & 0 deletions docfx/docs/TruckLib.ScsMap/map-class.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ Map map = Map.Open(@"E:\SteamLibrary\steamapps\common\Euro Truck Simulator 2\ext
If you would like to load specific sectors only, use the optional `sectors` parameter.
It expects a list or array of [sector coordinates](xref:TruckLib.ScsMap.SectorCoordinate).

There is an additional overload which allows loading a map directly from a .scs file using a
[`IHashFsReader`](~/docs/TruckLib.HashFs/hashfs.md):

```cs
using TruckLib.HashFs;
using TruckLib.ScsMap;

IHashFsReader reader = HashFsReader.Open("base_map.scs");
Map map = Map.Open("/map/europe.mbd", reader);
```

## Saving a map
To save a map, call the [`Save`](xref:TruckLib.ScsMap.Map.Save*) method of the map object. The map will be
written to the specified directory.
Expand Down
13 changes: 12 additions & 1 deletion docfx/docs/TruckLib.Sii/sii.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,18 @@ of the included files are relative to. (`Open` resolves this automatically.)
SiiFile sii = SiiFile.Load(siiStr, "/path/where/included/files/are/located");
```

If an included file does not exist, `FileNotFoundException` is thrown.
If an included file does not exist, `FileNotFoundException` is thrown unless the `ignoreMissingIncludes` parameter is set to true.

There are additional overloads which allow loading a .sii file directly from a .scs file using a
[`IHashFsReader`](~/docs/TruckLib.HashFs/hashfs.md):

```cs
using TruckLib.HashFs;
using TruckLib.Sii;

IHashFsReader reader = HashFsReader.Open("def.scs");
SiiFile sii = SiiFile.Open("/def/country.sii", reader);
```

### Data types
* Numbers which have a decimal component are parsed to `float`; numbers without will be the smallest of
Expand Down

0 comments on commit 47d99fb

Please sign in to comment.