Class TwoDA

2da file

class TwoDA ;

Constructors

NameDescription
this (filepath) Read a 2da file
this (rawData, name) Parse raw data

Fields

NameTypeDescription
fileName stringOptional 2DA file name set during construction

Properties

NameTypeDescription
columns[get] ulongNumber of named columns in the 2da (i.e. without the index column)
fileType[get, set] stringFile type (should always be "2DA") Max width: 4 chars
fileVersion[get, set] stringFile version (should always be "V2.0") Max width: 4 chars
rows[get] ulongNumber of rows in the 2da
rows[set] ulongResize the 2da table

Methods

NameDescription
columnIndex (colName) Get the index of a column by its name, for faster access
extractRowData (line) Parse a 2DA row
get (colIndex, line) Get a value in the 2da, converted to T.
get (colName, line, defaultValue) Get a value in the 2da, converted to T.
get (colName, line) ditto
opBinaryRight (colName) Check if a column exists in the 2da, and returns a pointer to its index
opIndex (column, row) Get a specific cell value
opIndex (i)
opIndexAssign (value, i)
recover (filepath) Recover a damaged 2DA file
serialize () Outputs 2da text content