• Home
  • Blog
  • Docs
  • GitHub
Show / Hide Table of Contents

Interface IGameInstaller

Installs files to an IGame by yielding TaskResult<T>.

Inherited Members
IPlugin.Name
IPlugin.Author
IPlugin.Description
IPlugin.Version
System.IDisposable.Dispose()
Namespace: Snowflake.Installation.Extensibility
Assembly: Snowflake.Framework.Primitives.dll
Syntax
public interface IGameInstaller : IPlugin, IDisposable

Properties

SupportedPlatforms

Platforms this IGameInstaller supports. There can be at most one instance of a IGameInstaller per platform, and they must support installing all forms of ROM files for that platform.

Declaration
IEnumerable<PlatformId> SupportedPlatforms { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<PlatformId>

Methods

GetInstallables(PlatformId, IEnumerable<FileSystemInfo>)

Queries all installable file system entries in a given parent directory.

This method should not perform any file write operations.

Declaration
IEnumerable<IInstallable> GetInstallables(PlatformId platformId, IEnumerable<FileSystemInfo> fileEntries)
Parameters
Type Name Description
PlatformId platformId

The platform to lookup installables for.

System.Collections.Generic.IEnumerable<System.IO.FileSystemInfo> fileEntries

A list of file system entries to search. Typically this may be a list of file entries in a directory.

Returns
Type Description
System.Collections.Generic.IEnumerable<IInstallable>

A list of installables that can be used with Install(IGame, IEnumerable<FileSystemInfo>, CancellationToken)

Install(IGame, IEnumerable<FileSystemInfo>, CancellationToken)

Installs files to an IGame by yielding instances of TaskResult<T>. Instead of doing manual file manipulation, use installation tasks. AsyncInstallTask<T> and AsyncInstallTaskEnumerable<T>.

This method is not allowed to throw. Exceptions may only occur within AsyncInstallTask<T> and AsyncInstallTaskEnumerable<T> awaited by this System.Collections.Generic.IAsyncEnumerable<T> to yield TaskResult<T> instances.

Declaration
IAsyncEnumerable<TaskResult<IFile>> Install(IGame game, IEnumerable<FileSystemInfo> files, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
IGame game

The game to install the files to.

System.Collections.Generic.IEnumerable<System.IO.FileSystemInfo> files

The list of files to install. Use GetInstallables(PlatformId, IEnumerable<FileSystemInfo>) to ensure that this installer can properly install the given files.

System.Threading.CancellationToken cancellationToken

The cancellation token to pass to the installer.

Returns
Type Description
System.Collections.Generic.IAsyncEnumerable<TaskResult<IFile>>

The files that were installed to the game.

Built with ❤️ by @chyyran. Text content licensed under CC-BY-SA 4.0.