Table of Contents

Class TuningCommenter

Namespace
LlamaLogic.TuningArchive
Assembly
LlamaLogic.TuningArchive.dll

Adds to tuning the comments XML Extractor adds, as a snapshot knows them: the text of each string after its key, and the class and name of the tuning or animation state machine each reference refers to

public sealed class TuningCommenter
Inheritance
TuningCommenter
Inherited Members

Remarks

The comments are the ones ExportAsync(TuningArchiveSnapshot, string, TuningArchiveExportOptions?, IProgress<TuningArchiveProgress>?, CancellationToken) writes: found with the snapshot's tuning descriptions when it has them and they describe the tuning, and otherwise as XML Extractor finds them, as any number that is a string's key or a tuning's instance. References to tuning of packs that were not installed when the snapshot was captured are commented with the names the packs' patches give it (see GetUninstalledTunings(TuningArchiveSnapshot)). The game ignores comments, so tuning with them loads as it would without them.

Properties

ReferenceComments

Gets whether references are commented with the class and name of what they refer to

public bool ReferenceComments { get; }

Property Value

bool

StringComments

Gets whether string keys are commented with the text of their strings

public bool StringComments { get; }

Property Value

bool

Methods

Comment(string)

Gets the specified tuning text with comments, or the text as it is if it is not XML

public string Comment(string text)

Parameters

text string

Returns

string

Remarks

Comments already in the text are kept. The result is indented with two spaces, with the line ends the text has, and starts with an XML declaration if the text does.

CommentFragment(string)

Gets the specified fragment of tuning (one element, such as GetFragmentText(XElement) gets) with comments on one line, or the fragment as it is if it is not XML

public string CommentFragment(string fragment)

Parameters

fragment string

Returns

string

Remarks

A fragment has no tuning around it for its tuning descriptions to describe, so its comments are found as XML Extractor finds them.

Create(TuningArchiveFile, TuningArchiveSnapshot, bool, bool)

Creates a commenter with what the specified snapshot of the specified archive knows

public static TuningCommenter Create(TuningArchiveFile archive, TuningArchiveSnapshot snapshot, bool stringComments = true, bool referenceComments = true)

Parameters

archive TuningArchiveFile

The archive

snapshot TuningArchiveSnapshot

The snapshot whose strings, tuning names and tuning descriptions the comments come from

stringComments bool

Whether to comment string keys with the text of their strings

referenceComments bool

Whether to comment references with the class and name of what they refer to

Returns

TuningCommenter