Skip to content

AtlasOptionExtensions

Namespace: Shadop.Archmage.Sdk

Extension methods for fluent configuration of AtlasOptions using the builder pattern.

public static class AtlasOptionExtensions

Inheritance Object → AtlasOptionExtensions

Remarks:

All methods return the AtlasOptions instance to enable method chaining.

Sets custom logger (defaults to console).

public static AtlasOptions WithLogger(AtlasOptions opts, IAtlasLogger logger)

opts AtlasOptions

logger IAtlasLogger

AtlasOptions

ArgumentNullException
Thrown if logger is null.

Sets custom filesystem (in-memory, embedded, virtual, etc.).

public static AtlasOptions WithFS(AtlasOptions opts, IFS fs)

opts AtlasOptions

fs IFS

AtlasOptions

ArgumentNullException
Thrown if fs is null.

Registers callback to modify atlas.json after loading.

public static AtlasOptions WithAtlasModifier(AtlasOptions opts, Action<AtlasJson> modifier)

opts AtlasOptions

modifier Action

AtlasOptions

ArgumentNullException
Thrown if modifier is null.

Specifies whitelist (if set, blacklist ignored; loads only whitelisted items).

public static AtlasOptions WithWhitelist(AtlasOptions opts, IEnumerable<string> whitelist)

opts AtlasOptions

whitelist IEnumerable

AtlasOptions

ArgumentNullException
Thrown if whitelist is null.

Specifies blacklist (ignored if whitelist present; skips blacklisted items).

public static AtlasOptions WithBlacklist(AtlasOptions opts, IEnumerable<string> blacklist)

opts AtlasOptions

blacklist IEnumerable

AtlasOptions

ArgumentNullException
Thrown if blacklist is null.

Selects the variant to load for the item identified by key (a variant-mapped item that is not given a variant falls back to “/”).

public static AtlasOptions WithVariant(AtlasOptions opts, string key, string variant)

opts AtlasOptions

key String

variant String

AtlasOptions

ArgumentNullException
Thrown if key or variant is null.

Adds directory as override source (processed in order; each can override previous).

public static AtlasOptions WithOverrideRoot(AtlasOptions opts, string rootPath)

opts AtlasOptions

rootPath String

AtlasOptions

ArgumentException
Thrown if rootPath is null or whitespace.

Adds custom filesystem as override source (embedded, network, in-memory, etc.). When rootPath is specified, override files are resolved relative to that path within the filesystem.

public static AtlasOptions WithOverrideFS(AtlasOptions opts, IFS fs, string rootPath)

opts AtlasOptions

fs IFS

rootPath String

AtlasOptions

ArgumentNullException
Thrown if fs is null.

Sets the maximum number of atlas items that can be loaded concurrently (default: 32). This limits the number of open files, the memory held by file contents, and the amount of deserialization work queued on the thread pool.

public static AtlasOptions WithMaxConcurrency(AtlasOptions opts, int n)

opts AtlasOptions

n Int32

AtlasOptions

ArgumentOutOfRangeException
Thrown if n is less than 1.

Parses atlas items on the main thread and does not use the thread pool. Use this where the thread pool is not available. Unity WebGL builds always parse this way.

public static AtlasOptions WithMainThreadParsing(AtlasOptions opts)

opts AtlasOptions

AtlasOptions

WithJsonSettings(AtlasOptions, JsonSerializerSettings)

Section titled “WithJsonSettings(AtlasOptions, JsonSerializerSettings)”

Sets custom JSON settings.

public static AtlasOptions WithJsonSettings(AtlasOptions opts, JsonSerializerSettings settings)

opts AtlasOptions

settings JsonSerializerSettings

AtlasOptions

ArgumentNullException
Thrown if settings is null.