Enum kerbalobjects::KOSValue
source · pub enum KOSValue {
}
Expand description
An internal value within Kerbal Operating System.
These are documented within the GitHub repo’s KSM Docs. These are used as operands to instructions and stored in the KO file’s data section, and a KSM file’s argument section.
Each value takes up 1 byte just for the “data type” so that kOS knows how to load the value.
The “Value” types (ScalarInt, ScalarDouble, BoolValue, StringValue) are different from their non-value counterparts in that the “Value” types have more built-in suffixes, and are the type used when there are any user-created values, as opposed to instruction operands. See KSM docs for more information.
Variants§
Null
A null value, rarely used. Only takes up 1 byte.
Bool(bool)
A boolean. Takes up 2 bytes.
Byte(i8)
A signed byte. Takes up 2 bytes.
Int16(i16)
A signed 16-bit integer. Takes up 3 bytes.
Int32(i32)
A signed 32-bit integer. Takes up 5 bytes.
Float(f32)
A 32-bit floating point number. Takes up 5 bytes.
Double(f64)
A 64-bit floating point number. Takes up 9 bytes.
String(String)
A string. Takes up 2 + length bytes.
ArgMarker
An argument marker. Takes up 1 byte.
ScalarInt(i32)
A signed 32-bit integer. Takes up 5 bytes.
ScalarDouble(f64)
A 64-bit floating point number. Takes up 9 bytes.
BoolValue(bool)
A boolean. Takes up 2 bytes.
StringValue(String)
A string. Takes up 2 + length bytes.