OpenTD.Results.Dataset.DataArray Class Reference
Last update: 16.07.2025Data is returned from Datasets in the form of DataArrays, which in addition to containing the actual data, also know the physical dimension of the data, what units it is in, and have a reference to the Dataset it came from. Use the GetValues methods to get the data as lists of doubles, or use DataArrays directly as inputs to SimplePlots. More...

Public Member Functions | |
| DataArray (DataItemIdentifier dataItem, IEnumerable< double > values, UnitsData units) | |
| DataArray () | |
| DataArray (IEnumerable< double > values) | |
| Initializes a new instance of the DataArray class, assuming dimensionless data. | |
| DataArray (DataSubtype subtype, IEnumerable< double > values, UnitsData units, ItemIdentifier item=null) | |
| DataArray (DataArray x) | |
| virtual void | SetValues (IEnumerable< double > values, DataSubtype subtype=null, UnitsData units=null, ItemIdentifier item=null) |
| List< double > | GetValues () |
| Gets the data in the current WorkingUnits. | |
| virtual List< double > | GetValues (UnitsData units) |
| Gets the data in the units provided. | |
| override string | ToString () |
| IEnumerator< double > | GetEnumerator () |
Static Public Member Functions | |
| static implicit | operator List< double > (DataArray x) |
| static implicit | operator List< DataArray > (DataArray x) |
Protected Member Functions | |
| virtual void | CheckData () |
| virtual string | GetSelfSuggestedName () |
| virtual string | GetSelfSuggestedComment () |
Protected Attributes | |
| List< double > | ValuesSI |
Properties | |
| virtual IDataset | SourceDataset [get, set] |
| The source Dataset for this data. | |
| virtual ItemIdentifier | SourceItem [get, set] |
| Identifies the item (node, lump, register, etc.) this data came from. | |
| virtual DataSubtype | Subtype [get, set] |
| The DataSubtype (T, TL, PL, GTX, etc.) | |
| DataItemIdentifier | SourceDataItem [get] |
| Combines the SourceItem and Subtype. If either are null, this is null. | |
| UnitsData.UnitsType | Dimension [get] |
| The physical dimension of this data. | |
| bool | IsInteger [get] |
| Returns true if the subtype of this data represents integer data. | |
| virtual int | Count [get] |
| The number of items in this DataArray. | |
| virtual double | this[int index] [get, set] |
| AutoNamer | AutoNamer [get, set] |
| string | Name [get, set] |
| string | InternalSuggestedName [get, set] |
| AutoCommenter | AutoCommenter [get, set] |
| string | Comment [get, set] |
| string | InternalSuggestedComment [get, set] |
Detailed Description
Data is returned from Datasets in the form of DataArrays, which in addition to containing the actual data, also know the physical dimension of the data, what units it is in, and have a reference to the Dataset it came from. Use the GetValues methods to get the data as lists of doubles, or use DataArrays directly as inputs to SimplePlots.
Constructor & Destructor Documentation
◆ DataArray() [1/5]
|
inline |
◆ DataArray() [2/5]
|
inline |
◆ DataArray() [3/5]
|
inline |
Initializes a new instance of the DataArray class, assuming dimensionless data.
- Parameters
-
values The values.
◆ DataArray() [4/5]
|
inline |
◆ DataArray() [5/5]
|
inline |
Member Function Documentation
◆ CheckData()
|
inlineprotectedvirtual |
Reimplemented in OpenTD.Results.Dataset.AverageDataArray, OpenTD.Results.Dataset.DerivedDataArray, OpenTD.Results.Dataset.FormulaDataArray, OpenTD.Results.Dataset.MaxDataArray, OpenTD.Results.Dataset.MinDataArray, OpenTD.Results.Dataset.OneSubtypeDerivedDataArray, OpenTD.Results.Dataset.SelectOneDataArray, and OpenTD.Results.Dataset.WeightedAverageDataArray.
◆ GetEnumerator()
|
inline |
◆ GetSelfSuggestedComment()
|
inlineprotectedvirtual |
◆ GetSelfSuggestedName()
|
inlineprotectedvirtual |
Reimplemented in OpenTD.Results.Dataset.AverageDataArray, OpenTD.Results.Dataset.DerivedDataArray, OpenTD.Results.Dataset.FormulaDataArray, OpenTD.Results.Dataset.MaxDataArray, OpenTD.Results.Dataset.MinDataArray, OpenTD.Results.Dataset.SelectOneDataArray, OpenTD.Results.Dataset.SumDataArray, and OpenTD.Results.Dataset.WeightedAverageDataArray.
◆ GetValues() [1/2]
|
inline |
Gets the data in the current WorkingUnits.
- Returns
- List<System.Double>.
- See also
- OpenTD.Units.WorkingUnits
◆ GetValues() [2/2]
|
inlinevirtual |
Gets the data in the units provided.
- Parameters
-
units The units to return the data in.
- Returns
- List<System.Double>.
Reimplemented in OpenTD.Results.Dataset.DerivedDataArray, and OpenTD.Results.Dataset.SelectOneDataArray.
◆ operator List< DataArray >()
|
inlinestatic |
◆ operator List< double >()
|
inlinestatic |
◆ SetValues()
|
inlinevirtual |
◆ ToString()
|
inline |
Member Data Documentation
◆ ValuesSI
|
protected |
Property Documentation
◆ AutoCommenter
|
getsetprotected |
◆ AutoNamer
|
getsetprotected |
◆ Comment
|
getset |
Implements OpenTD.Results.Dataset.IAutoComment.
◆ Count
|
get |
The number of items in this DataArray.
◆ Dimension
|
get |
The physical dimension of this data.
◆ InternalSuggestedComment
|
getset |
Implements OpenTD.Results.Dataset.IAutoComment.
◆ InternalSuggestedName
|
getset |
Implements OpenTD.Results.Dataset.IAutoName.
◆ IsInteger
|
get |
Returns true if the subtype of this data represents integer data.
◆ Name
|
getset |
Implements OpenTD.Results.Dataset.IAutoName.
◆ SourceDataItem
|
get |
Combines the SourceItem and Subtype. If either are null, this is null.
◆ SourceDataset
|
getset |
The source Dataset for this data.
◆ SourceItem
|
getset |
Identifies the item (node, lump, register, etc.) this data came from.
◆ Subtype
|
getset |
The DataSubtype (T, TL, PL, GTX, etc.)
◆ this[int index]
|
getset |
The documentation for this class was generated from the following file:
- C:/Users/mgarrett/source/repos/BuildsTdSuite/builds/OpenTD/OpenTD.Results/Dataset/DataArray.cs