Show / Hide Table of Contents

Class BlocksFile

Connects to BLOCKS.BSA to enumerate and extract city and dungeon blocks.

Inheritance
Object
BlocksFile
Namespace: DaggerfallConnect.Arena2
Assembly: Assembly-CSharp.dll
Syntax
public class BlocksFile

Constructors

| Improve this Doc View Source

BlocksFile()

Default constructor.

Declaration
public BlocksFile()
| Improve this Doc View Source

BlocksFile(String, FileUsage, Boolean)

Load constructor.

Declaration
public BlocksFile(string filePath, FileUsage usage, bool readOnly)
Parameters
Type Name Description
String filePath

Absolute path to BLOCKS.BSA.

FileUsage usage

Determines if the BSA file will read from disk or memory.

Boolean readOnly

File will be read-only if true, read-write if false.

Properties

| Improve this Doc View Source

AutoDiscard

If true then decomposed block records will be destroyed every time a different block is fetched. If false then decomposed block records will be maintained until DiscardRecord() or DiscardAllRecords() is called. Turning off auto-discard will speed up block retrieval times at the expense of RAM. For best results, disable auto-discard and impose your own caching scheme using LoadBlock() and DiscardBlock() based on your application needs.

Declaration
public bool AutoDiscard { get; set; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

Count

Number of BSA records in BLOCKS.BSA.

Declaration
public int Count { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Filename

Gets default BLOCKS.BSA filename.

Declaration
public static string Filename { get; }
Property Value
Type Description
String
| Improve this Doc View Source

RDBDimension

Gets dimension of a single RDB block.

Declaration
public static float RDBDimension { get; }
Property Value
Type Description
Single
| Improve this Doc View Source

RMBDimension

Gets dimension of a single RMB block.

Declaration
public static float RMBDimension { get; }
Property Value
Type Description
Single
| Improve this Doc View Source

RotationDivisor

Gets rotation divisor used when rotating block records and models into place.

Declaration
public static float RotationDivisor { get; }
Property Value
Type Description
Single
| Improve this Doc View Source

ScaleDivisor

Gets scale divisor for billboards.

Declaration
public static float ScaleDivisor { get; }
Property Value
Type Description
Single
| Improve this Doc View Source

TileDimension

Gets dimension of a single RMB ground tile.

Declaration
public static float TileDimension { get; }
Property Value
Type Description
Single

Methods

| Improve this Doc View Source

CheckName(String)

Checks block name and substitutes fixed name if possible.

Declaration
public string CheckName(string name)
Parameters
Type Name Description
String name

Block name.

Returns
Type Description
String

Block name or String.Empty if no fix possible.

| Improve this Doc View Source

DiscardAllBlocks()

Discard all block records.

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

DiscardBlock(Int32)

Discard a block from memory.

Declaration
public void DiscardBlock(int block)
Parameters
Type Name Description
Int32 block

Index of block to discard.

| Improve this Doc View Source

GetBlock(Int32)

Gets a DFBlock representation of a record.

Declaration
public DFBlock GetBlock(int block)
Parameters
Type Name Description
Int32 block

Index of block to load.

Returns
Type Description
DFBlock

DFBlock object.

| Improve this Doc View Source

GetBlock(String)

Gets a DFBlock by name.

Declaration
public DFBlock GetBlock(string name)
Parameters
Type Name Description
String name

Name of block.

Returns
Type Description
DFBlock

DFBlock object.

| Improve this Doc View Source

GetBlockAutoMap(in DFBlock, Boolean)

Gets block AutoMap by name.

Declaration
public static DFBitmap GetBlockAutoMap(in DFBlock block, bool removeGroundFlats)
Parameters
Type Name Description
DFBlock block

Reference to block.

Boolean removeGroundFlats

Filters ground flat "speckles" from the AutoMap.

Returns
Type Description
DFBitmap

DFBitmap object.

| Improve this Doc View Source

GetBlockIndex(String)

Gets index of block with specified name. Does not change the currently loaded block. Uses a dictionary to map name to index so this method will be faster on subsequent calls.

Declaration
public int GetBlockIndex(string name)
Parameters
Type Name Description
String name

Name of block.

Returns
Type Description
Int32

Index of found block, or -1 if not found.

| Improve this Doc View Source

GetBlockName(Int32)

Gets name of specified block. Does not change the currently loaded block.

Declaration
public string GetBlockName(int block)
Parameters
Type Name Description
Int32 block

Index of block.

Returns
Type Description
String

Name of the block.

| Improve this Doc View Source

GetBlockType(Int32)

Gets the type of specified block. Does not change the currently loaded block.

Declaration
public DFBlock.BlockTypes GetBlockType(int block)
Parameters
Type Name Description
Int32 block

Index of block.

Returns
Type Description
DFBlock.BlockTypes

DFBlock.blockTypes object.

| Improve this Doc View Source

GetRdbType(String)

Get RDB block type (quest, normal, wet, etc.) Does not return RdbTypes.Start as this can only be derived from map data.

Declaration
public DFBlock.RdbTypes GetRdbType(string blockName)
Parameters
Type Name Description
String blockName

Name of RDB block.

Returns
Type Description
DFBlock.RdbTypes

DFBlock.RdbTypes object.

| Improve this Doc View Source

Load(String, FileUsage, Boolean)

Load BLOCKS.BSA file.

Declaration
public bool Load(string filePath, FileUsage usage, bool readOnly)
Parameters
Type Name Description
String filePath

Absolute path to BLOCKS.BSA file.

FileUsage usage

Specify if file will be accessed from disk, or loaded into RAM.

Boolean readOnly

File will be read-only if true, read-write if false.

Returns
Type Description
Boolean

True if successful, otherwise false.

| Improve this Doc View Source

LoadBlock(Int32)

Load a block into memory and decompose it for use.

Declaration
public bool LoadBlock(int block)
Parameters
Type Name Description
Int32 block

Index of block to load.

Returns
Type Description
Boolean

True if successful, otherwise false.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX