Skip to content

Class VfsWatcher

Namespace: Apogee.Content.FileSystem
Assembly: Apogee.Content.dll

Notices when files of a change, for hot reload. It watches every folder that backs a mount (zips and packs do not change under a running game) and gives the changes as virtual paths: the one the file has through the mount it was found in, and every other path that is a view of it (a package at res://packages/core is also mod://core). Saving a file usually makes several events (a temporary file, a rename, a write): a path is reported once, after it has been quiet for debounce. Files and folders whose name starts with a dot, and editors' temporary files, are ignored. Create it after the mounts; call from the thread that owns what is reloaded.

public sealed class VfsWatcher : IDisposable

Inheritance

object ← VfsWatcher

Implements

IDisposable

Inherited Members

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

Constructors

VfsWatcher(VirtualFileSystem, TimeSpan?)

public VfsWatcher(VirtualFileSystem files, TimeSpan? debounce = null)

Parameters

files VirtualFileSystem

debounce TimeSpan?

Methods

Dispose()

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

public void Dispose()

TakeChanges()

The paths that changed and have been quiet for the debounce time, sorted; each is returned once.

public IReadOnlyList<string> TakeChanges()

Returns

IReadOnlyList<string>