Skip to content

Class PackageSet

Namespace: Apogee.Content.Packages
Assembly: Apogee.Content.dll

The packages of a game: the base game's and the mods. finds them (), reads their manifests, decides which load and in which order (), and mounts each one that loads at mod://<id>/, whatever it is (a folder, a zip), so that a package's files have one address everywhere. What is wrong with a package that does not load is in its ; what is wrong with the search itself (a manifest that does not parse, an id that is not its folder's name) is in . Dispose it to take the mounts away.

public sealed class PackageSet : IDisposable

Inheritance

object ← PackageSet

Implements

IDisposable

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Properties

ContentFolders

The folders of definitions of the packages that load, in load order, at their mod:// addresses.

public IReadOnlyList<DefFolder> ContentFolders { get; }

Property Value

IReadOnlyList<DefFolder>

LoadOrder

The ones that load, dependencies first.

public IReadOnlyList<SolvedPackage> LoadOrder { get; }

Property Value

IReadOnlyList<SolvedPackage>

Packages

Every package found, whether it loads or not.

public IReadOnlyList<SolvedPackage> Packages { get; }

Property Value

IReadOnlyList<SolvedPackage>

Problems

public IReadOnlyList<string> Problems { get; }

Property Value

IReadOnlyList<string>

SchemaFolders

The folders of schemas of the packages that load, in load order.

public IReadOnlyList<string> SchemaFolders { get; }

Property Value

IReadOnlyList<string>

Scripts

The scripts of the packages that load: in load order, and in each package in the order its manifest lists them.

public IReadOnlyList<(SolvedPackage Package, string Path)> Scripts { get; }

Property Value

IReadOnlyList<(SolvedPackage Package, string Path)>

Methods

Address(SolvedPackage, string)

The address of a path inside a package: mod://<id>/<path>.

public static string Address(SolvedPackage package, string path)

Parameters

package SolvedPackage

path string

Returns

string

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Find(string)

public SolvedPackage? Find(string id)

Parameters

id string

Returns

SolvedPackage?

Load(VirtualFileSystem, PackageOptions?)

Finds, solves and mounts the packages. files must have what the options point at mounted (the game's content at res://, the player's folder at user://); a missing folder is simply no packages.

public static PackageSet Load(VirtualFileSystem files, PackageOptions? options = null)

Parameters

files VirtualFileSystem

options PackageOptions?

Returns

PackageSet

LoadDefs()

Reads the definitions of the packages that load and checks them against their schemas.

public DefDatabase LoadDefs()

Returns

DefDatabase

LoadSchemas()

Loads the schemas of the packages that load (a package whose schema is wrong is reported in and its schemas are left out).

public SchemaSet LoadSchemas()

Returns

SchemaSet