Show / Hide Table of Contents

Class SaveTree

Represents a SAVETREE.DAT file.

Inheritance
Object
SaveTree
Namespace: DaggerfallConnect.Save
Assembly: Assembly-CSharp.dll
Syntax
public class SaveTree

Constructors

| Improve this Doc View Source

SaveTree()

Default constructor.

Declaration
public SaveTree()
| Improve this Doc View Source

SaveTree(String, Boolean)

Open constructor.

Declaration
public SaveTree(string saveTreePath, bool readOnly = true)
Parameters
Type Name Description
String saveTreePath

Full path to SAVETREE.DAT file.

Boolean readOnly

Flag to open file in read-only mode.

Fields

| Improve this Doc View Source

BuildingRecords

Declaration
public SaveTreeBuildingRecords BuildingRecords
Field Value
Type Description
SaveTreeBuildingRecords
| Improve this Doc View Source

Filename

Declaration
public const string Filename = "SAVETREE.DAT"
Field Value
Type Description
String
| Improve this Doc View Source

Header

Declaration
public SaveTreeHeader Header
Field Value
Type Description
SaveTreeHeader
| Improve this Doc View Source

RecordDictionary

Declaration
public Dictionary<uint, SaveTreeBaseRecord> RecordDictionary
Field Value
Type Description
Dictionary<UInt32, SaveTreeBaseRecord>
| Improve this Doc View Source

RootRecord

Declaration
public SaveTreeBaseRecord RootRecord
Field Value
Type Description
SaveTreeBaseRecord

Methods

| Improve this Doc View Source

FilterRecordsByParentType(List<SaveTreeBaseRecord>, RecordTypes)

Filters a record list by parent type.

Declaration
public List<SaveTreeBaseRecord> FilterRecordsByParentType(List<SaveTreeBaseRecord> source, RecordTypes parentType)
Parameters
Type Name Description
List<SaveTreeBaseRecord> source

Source list.

RecordTypes parentType

Parent type to filter for.

Returns
Type Description
List<SaveTreeBaseRecord>

New list of items with specific parent type.

| Improve this Doc View Source

FindRecord(RecordTypes, SaveTreeBaseRecord)

Finds first record of type in tree starting from root record.

Declaration
public SaveTreeBaseRecord FindRecord(RecordTypes type, SaveTreeBaseRecord root = null)
Parameters
Type Name Description
RecordTypes type

Type of record to search for.

SaveTreeBaseRecord root

Root record to start searching from. If null, will start from RecordRoot.

Returns
Type Description
SaveTreeBaseRecord

Found item or null if not found.

| Improve this Doc View Source

FindRecords(RecordTypes, SaveTreeBaseRecord)

Finds all instances of a specific record type in tree starting from root record.

Declaration
public List<SaveTreeBaseRecord> FindRecords(RecordTypes type, SaveTreeBaseRecord root = null)
Parameters
Type Name Description
RecordTypes type

Type of record to search for.

SaveTreeBaseRecord root

Root record to start searching from. If null, will start from RecordRoot.

Returns
Type Description
List<SaveTreeBaseRecord>

List of records found. May contain 0 records.

| Improve this Doc View Source

Open(String, Boolean)

Opens a SAVETREE.DAT file. Always uses FileUsage.UseDisk so possible to write back to original file.

Declaration
public bool Open(string saveTreePath, bool readOnly = true)
Parameters
Type Name Description
String saveTreePath

Full path to SAVETREE.DAT file.

Boolean readOnly

Flag to open file in read-only mode.

Returns
Type Description
Boolean
| Improve this Doc View Source

PeekRecordType(BinaryReader)

Peeks record type from beginning of RecordRoot without moving stream position.

Declaration
public static RecordTypes PeekRecordType(BinaryReader reader)
Parameters
Type Name Description
BinaryReader reader

Reader positioned at start of RecordRoot data.

Returns
Type Description
RecordTypes

Record type.

| Improve this Doc View Source

ReadPosition(BinaryReader)

Read RecordPosition data from binary stream.

Declaration
public static RecordPosition ReadPosition(BinaryReader reader)
Parameters
Type Name Description
BinaryReader reader

BinaryReader positioned at start of Position data.

Returns
Type Description
RecordPosition

RecordPosition struct.

| Improve this Doc View Source

Save()

Saves changes to SAVETREE.DAT file. Must have been opened with readOnly=false.

Declaration
public void Save()
| Improve this Doc View Source

WritePosition(BinaryWriter, RecordPosition)

Write Position data to a binary stream.

Declaration
public static void WritePosition(BinaryWriter writer, RecordPosition position)
Parameters
Type Name Description
BinaryWriter writer

BinaryWriter positioned at start of Position data.

RecordPosition position

RecordPosition data to write.

  • Improve this Doc
  • View Source
In This Article
  • Constructors
    • SaveTree()
    • SaveTree(String, Boolean)
  • Fields
    • BuildingRecords
    • Filename
    • Header
    • RecordDictionary
    • RootRecord
  • Methods
    • FilterRecordsByParentType(List<SaveTreeBaseRecord>, RecordTypes)
    • FindRecord(RecordTypes, SaveTreeBaseRecord)
    • FindRecords(RecordTypes, SaveTreeBaseRecord)
    • Open(String, Boolean)
    • PeekRecordType(BinaryReader)
    • ReadPosition(BinaryReader)
    • Save()
    • WritePosition(BinaryWriter, RecordPosition)
Back to top Generated by DocFX