Class BlocksFile
Connects to BLOCKS.BSA to enumerate and extract city and dungeon blocks.
Namespace: DaggerfallConnect.Arena2
Assembly: Assembly-CSharp.dll
Syntax
public class BlocksFile
Constructors
| Improve this Doc View SourceBlocksFile()
Default constructor.
Declaration
public BlocksFile()
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 SourceAutoDiscard
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 |
Count
Number of BSA records in BLOCKS.BSA.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
Filename
Gets default BLOCKS.BSA filename.
Declaration
public static string Filename { get; }
Property Value
Type | Description |
---|---|
String |
RDBDimension
Gets dimension of a single RDB block.
Declaration
public static float RDBDimension { get; }
Property Value
Type | Description |
---|---|
Single |
RMBDimension
Gets dimension of a single RMB block.
Declaration
public static float RMBDimension { get; }
Property Value
Type | Description |
---|---|
Single |
RotationDivisor
Gets rotation divisor used when rotating block records and models into place.
Declaration
public static float RotationDivisor { get; }
Property Value
Type | Description |
---|---|
Single |
ScaleDivisor
Gets scale divisor for billboards.
Declaration
public static float ScaleDivisor { get; }
Property Value
Type | Description |
---|---|
Single |
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 SourceCheckName(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. |
DiscardAllBlocks()
Discard all block records.
Declaration
public void DiscardAllBlocks()
DiscardBlock(Int32)
Discard a block from memory.
Declaration
public void DiscardBlock(int block)
Parameters
Type | Name | Description |
---|---|---|
Int32 | block | Index of block to discard. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |