Assembly: OpenTD.dll Describes a system of units. Can be inconsistent.
Inheritance
object ← UnitsDataImplements
IEquatable<UnitsData>Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()Constructors
UnitsData()
UnitsData(string)
Initializes a new instance of the UnitsData class by parsing the supplied units expression string. Use with basic units (m, hr, Btu, etc.) or compound units expressions (Btu/hr/ft^2/F, kg/m-s, etc.). Recognizes strings in the same format output by TD. Accepted operators : ( ) / - ^ Exponents denoted with optional ^, e.g. m^3 and m3 are both valid W can be substituted for J/s 1 can be used, as in 1/m^3 Revolution can be used, as in Revolution/s Case-insensitive For overlapping model length and orbit length units (m and ft), assumes model lengthParameters
unitsExpression string
UnitsData(long, long)
Initializes a new instance of the UnitsData class, using integers written to save files or CSR’s by SINDA.Parameters
TdUnits long
TdUnits2 long
UnitsData(UnitsData)
Copy constructor.Parameters
source UnitsData
Properties
FlocadOutputUnits
Property Value
UnitsData.FlocadOutputUnitsTypeangle
Property Value
UnitsData.Anglecurrent
Property Value
UnitsData.Currentdef
Use def to create arbitrary combinations of units (advanced).Property Value
UnitsDefDataenergy
Property Value
UnitsData.Energyforce
Property Value
UnitsData.Forcemass
Property Value
UnitsData.MassmodelLength
Property Value
UnitsData.ModelLengthorbitLength
Property Value
UnitsData.OrbitLengthpressure
Property Value
UnitsData.Pressuretemp
Property Value
UnitsData.Temptime
Property Value
UnitsData.Timevoltage
Property Value
UnitsData.VoltageMethods
Equals(UnitsData)
Indicates whether the current object is equal to another object of the same type.Parameters
x UnitsData
Returns
bool true if the current object is equal to theother parameter; otherwise, false.
Equals(object)
Determines whether the specified object is equal to the current object.Parameters
obj object
The object to compare with the current object.
Returns
bool true if the specified object is equal to the current object; otherwise, false.GetHashCode()
Serves as the default hash function.Returns
int A hash code for the current object.GetName(UnitsType)
Parameters
type UnitsData.UnitsType
Returns
stringGetTitle(UnitsType)
Parameters
type UnitsData.UnitsType
Returns
stringGetUnitsName(UnitsType)
Parameters
type UnitsData.UnitsType
Returns
stringSetFrom(UnitsData)
Parameters
source UnitsData
SetFromDataset(long, long)
Set this units system based on 64-bit integers written to a save file or CSR by Sinda.Parameters
TdUnits long
TdUnits2 long
Exceptions
OpenTDException Problem decoding TdUnits. or Problem decoding TdUnits2.SetFromUnitsExpression(string)
Sets this UnitsData using the supplied string. Use with basic units (m, hr, Btu, etc.) or compound units expressions (Btu/hr/ft^2/F, kg/m-s, etc.). For basic units, SetFromBasicUnit(string str) will be more efficient. Recognizes strings in the same format output by TD. Accepted operators : ( ) / - ^ Exponents denoted with optional ^, e.g. m^3 and m3 are both valid W can be substituted for J/s 1 can be used, as in 1/m^3 Revolution can be used, as in Revolution/s Case-insensitive For overlapping model length and orbit length units (m and ft), assumes model lengthParameters
str string
Returns
boolSetToEng()
SetToSI()
Text(OrbitLength)
Parameters
units UnitsData.OrbitLength
Returns
stringText(ModelLength)
Parameters
units UnitsData.ModelLength
Returns
stringText(Time)
Parameters
units UnitsData.Time
Returns
stringText(Energy)
Parameters
units UnitsData.Energy
Returns
stringText(Temp)
Parameters
units UnitsData.Temp
Returns
stringText(Mass)
Parameters
units UnitsData.Mass
Returns
stringText(Pressure)
Parameters
units UnitsData.Pressure
Returns
stringText(Angle)
Parameters
units UnitsData.Angle
Returns
stringText(Force)
Parameters
units UnitsData.Force
Returns
stringText(Current)
Parameters
units UnitsData.Current
Returns
stringText(Voltage)
Parameters
units UnitsData.Voltage
Returns
stringText(Resistance)
Parameters
units UnitsData.Resistance
Returns
stringToString()
Returns a string that represents the current object.Returns
string A string that represents the current object.Operators
operator ==(UnitsData, UnitsData)
Parameters
x1 UnitsData
x2 UnitsData
Returns
booloperator !=(UnitsData, UnitsData)
Parameters
x1 UnitsData
x2 UnitsData