Table of Contents

Class TuningXml

Namespace
LlamaLogic.TuningArchive
Assembly
LlamaLogic.TuningArchive.dll

Provides the canonical text form in which a tuning archive stores tuning and SimData documents

public static class TuningXml
Inheritance
TuningXml
Inherited Members

Remarks

The canonical form is UTF-8 without a byte order mark, an XML declaration, two-space indentation and line feeds, with comments removed. The root element's attributes are in ordinal order (c, i, m, n, s), and every other element's are n, then t, then the rest in ordinal order. Documents with the same content therefore have the same canonical text however they were obtained (from the game's combined tuning or from files extracted by another tool).

Methods

FindElement(XElement, string)

Finds the element at the specified path (as Path spells it, such as loot_list[2].stat) below the specified root, or returns null if there is none

public static XElement? FindElement(XElement root, string path)

Parameters

root XElement
path string

Returns

XElement

GetCanonicalText(XDocument)

Gets the canonical text of the specified document

public static string GetCanonicalText(XDocument document)

Parameters

document XDocument

Returns

string

GetCanonicalText(XElement)

Gets the canonical text of a document whose root is the specified root

public static string GetCanonicalText(XElement root)

Parameters

root XElement

Returns

string

GetFragmentText(XElement)

Gets the canonical text of the specified element on one line, without an XML declaration

public static string GetFragmentText(XElement element)

Parameters

element XElement

Returns

string

GetResourceType(string)

Gets the type of the tuning resource for the specified tuning type name (the i attribute of an instance, or the name of a group in combined tuning), the way the game derives it

public static ResourceType GetResourceType(string typeName)

Parameters

typeName string

Returns

ResourceType

HaveSameFragmentText(XElement, XElement)

Gets whether the specified elements have the same canonical text on one line (what GetFragmentText(XElement) gets for each), without writing either

public static bool HaveSameFragmentText(XElement a, XElement b)

Parameters

a XElement
b XElement

Returns

bool

Parse(string)

Parses canonical text (or any tuning XML) into a document with line information

public static XDocument Parse(string text)

Parameters

text string

Returns

XDocument