C# Класс FyreVM.Quetzal

Implements the Quetzal saved-game file specification by holding a list of typed data chunks which can be read from or written to streams.
http://www.ifarchive.org/if-archive/infocom/interpreters/specification/savefile_14.txt
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CompressMemory ( byte original, int origStart, int origLength, byte changed, int changedStart, int changedLength ) : byte[]

Compresses a block of memory by comparing it with the original version from the game file.

Contains ( string type ) : bool

Checks whether the Quetzal file contains a given chunk type.

DecompressMemory ( byte original, byte delta ) : byte[]

Reconstitutes a changed block of memory by applying a compressed set of differences to the original block from the game file.

FromStream ( Stream stream ) : Quetzal

Loads a collection of chunks from a Quetzal file.

Duplicate chunks are not supported by this class. Only the last chunk of a given type will be available.

Quetzal ( ) : System

Initializes a new chunk collection.

WriteToStream ( Stream stream ) : void

Writes the chunks to a Quetzal file.

this ( string type ) : byte[]

Gets or sets typed data chunks.

Приватные методы

Метод Описание
StrToID ( string type ) : uint

Описание методов

CompressMemory() публичный статический Метод

Compresses a block of memory by comparing it with the original version from the game file.
public static CompressMemory ( byte original, int origStart, int origLength, byte changed, int changedStart, int changedLength ) : byte[]
original byte An array containing the original block of memory.
origStart int The offset within the array where the original block /// starts.
origLength int The length of the original block, in bytes.
changed byte An array containing the changed block to be compressed.
changedStart int The offset within the array where the changed /// block starts.
changedLength int The length of the changed block. This may be /// greater than , but may not be less.
Результат byte[]

Contains() публичный Метод

Checks whether the Quetzal file contains a given chunk type.
public Contains ( string type ) : bool
type string The 4-character type identifier.
Результат bool

DecompressMemory() публичный статический Метод

Reconstitutes a changed block of memory by applying a compressed set of differences to the original block from the game file.
public static DecompressMemory ( byte original, byte delta ) : byte[]
original byte The original block of memory.
delta byte The RLE-compressed set of differences, /// prefixed with a 4-byte length. This length may be larger than /// the original block, but not smaller.
Результат byte[]

FromStream() публичный статический Метод

Loads a collection of chunks from a Quetzal file.
Duplicate chunks are not supported by this class. Only the last chunk of a given type will be available.
public static FromStream ( Stream stream ) : Quetzal
stream Stream The stream to read from.
Результат Quetzal

Quetzal() публичный Метод

Initializes a new chunk collection.
public Quetzal ( ) : System
Результат System

WriteToStream() публичный Метод

Writes the chunks to a Quetzal file.
public WriteToStream ( Stream stream ) : void
stream Stream The stream to write to.
Результат void

this() публичный Метод

Gets or sets typed data chunks.
public this ( string type ) : byte[]
type string The 4-character type identifier.
Результат byte[]