Skip to content

Class PackWriter

Namespace: Apogee.Content.Packs
Assembly: Apogee.Content.dll

Writes a pack: files added with (and paths taken away from the packs below it with , for a patch pack), then . Each file is compressed with zstd when that saves at least 10%, and sealed with AES-256-GCM when there is a key (see ). The pack is split into parts (game.pack, game_001.pack…) at ; mount the first with and it finds the rest.

public sealed class PackWriter : IDisposable

Inheritance

object ← PackWriter

Implements

IDisposable

Inherited Members

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

Constructors

PackWriter(string, PackWriterOptions?)

public PackWriter(string path, PackWriterOptions? options = null)

Parameters

path string

options PackWriterOptions?

Methods

Add(string, ReadOnlySpan<byte>)

Adds a file at path (relative, as in textures/ground.png).

public void Add(string path, ReadOnlySpan<byte> data)

Parameters

path string

data ReadOnlySpan<byte>

Exceptions

ArgumentException

The path is not valid or is in the pack already.

AddFile(string, string)

public void AddFile(string path, string physicalPath)

Parameters

path string

physicalPath string

Dispose()

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

public void Dispose()

Finish()

Writes the last part. Returns the files written, the first one first.

public IReadOnlyList<string> Finish()

Returns

IReadOnlyList<string>

Remove(string)

Takes path away from the packs this one is mounted over.

public void Remove(string path)

Parameters

path string