PlatformAPI reference
Interface IContentSource
Namespace: MicroEngine.Platform
Assembly: MicroEngine.Platform.dll
Guide: The platform host
Where a game’s content files come from: a folder next to the executable, a phone’s unpacked package, later an archive or a browser’s fetch. Paths are relative to the source with ‘/’ separators and match the stored name’s letter case exactly on every system.
public interface IContentSourceProperties
Location
Where the files are (a folder’s absolute path, or a description), for diagnostics.
string Location { get; }Property Value
Methods
Exists(string)
Whether a file exists at path. False for a missing file and for a path outside the source.
bool Exists(string path)Parameters
path string
Returns
Files(string)
The files directly inside folder (“” for the top), as paths relative to the source, in ordinal order.
IReadOnlyList<string> Files(string folder)Parameters
folder string
Returns
Exceptions
The folder does not exist.
Open(string)
Opens the file at path for reading; the caller disposes the stream.
Stream Open(string path)Parameters
path string
Returns
Exceptions
The path leaves the source.
No such file, or its name is spelled with another letter case.