Table of Contents

Interface ICompanionPackageSource

Namespace
Stride.Core.Assets
Assembly
Stride.Core.Assets.dll

Companion packages that the host adds to the sessions it loads, besides those the session's packages declare (CompanionPackageSource). The editor uses it for the extensions the user installed; the session itself knows nothing of them.

[Experimental("STREXP002")]
public interface ICompanionPackageSource
Extension Methods

Remarks

Each companion goes through the same steps as a declared one: the toolkit of the host, the session's ICompanionPackageFilter (asked with no declaring package), the dev redirect, the restore, and the session's IAssemblyLoadCheck when its assemblies load. A companion that a package of the session already brings (a project of the solution, or the companion of a package the game references) is not added a second time: the session's own one loads.

Properties

PackageSources

Folders (local NuGet feeds) where the restore of these companions also looks for packages, besides the NuGet sources configured for the session.

IReadOnlyList<string> PackageSources { get; }

Property Value

IReadOnlyList<string>

Methods

GetCompanionPackages(ILogger)

The companions to add. Read once per session, at its first load: a change after that applies to the next session.

IReadOnlyList<CompanionPackage> GetCompanionPackages(ILogger log)

Parameters

log ILogger

The log of the session's load.

Returns

IReadOnlyList<CompanionPackage>

The companions, each with its name, version and kind; the toolkit when it is written for one.

IsRestoredPackageExpected(string, PackageVersion, ILogger)

Whether the package the session restored for one of these companions is the one the host added. NuGet takes a package from any of its sources, so another source can serve another package with the same name and version. Called after the restore, before anything of the package loads; a companion that fails the check is not loaded.

bool IsRestoredPackageExpected(string name, PackageVersion version, ILogger log)

Parameters

name string

The name of the companion.

version PackageVersion

Its version.

log ILogger

The log of the session's load, where the source says why a package fails the check.

Returns

bool

true when the restored package can load.