Data types
阅读
2023-11-30更新
最新编辑:Lu_23333
阅读:
更新日期:2023-11-30
最新编辑:Lu_23333
This page describes common binary data types used by Cities: Skylines, and most modern day computer applications, internally.
Properties
Endianness
All data stored in computers are stored in single, small unit of data called a "byte". Larger units of data are split into multiple bytes. The order in which sequential bytes are assembled together to form a larger unit of data is referred to as it's "endianess". All data saved locally by Cities:Skylines is stored in "little"-endian format. For more information about endianness, please see the Wikipedia entry.
Signedness
Another property of data types is it's signedness. Please see the wikipedia entry. Data types without a u- prefix are signed, and those marked with a u- prefixed are unsigned. The type of signedness is generally abstracted away though native API methods.
Numeric Data Types
uint16
2 byte long unsigned integer type. Also referred to as a "short".
uint32
4 byte long unsigned integer type. Also referred to as a "int". The most common in Cities: Skylines.
uint64
8 byte long unsigned integer type. Also referred to as a "long".
Other Data Types
pstr
Strings in Cities: Skylines are stored Pascal-style – they're a variable length data type with two fields: an integer field describing how many bytes long the string data is, and then the string data itself. This differs from c style strings. In Cities: Skylines, similar to many other modern day software applications, use a variable length 7BitEncodedInt to designate the string length.
7BitEncodedInt
A 7BitEncodedInt is a variable length integer which consists of one to a maximum of five bytes. Only 7 bits are used to store the value in each bit, the most significant bit is set when another byte follows and unset when this byte is the last byte of the variable length integer.