全站通知:

Data types

阅读

    

2023-11-30更新

    

最新编辑:Lu_23333

阅读:

  

更新日期:2023-11-30

  

最新编辑:Lu_23333

来自城市:天际线WIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索
页面贡献者 :
xl123071
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.

说明

本文内容长期有效,适用任何游戏版本。

本页内容最初译自官方Wiki:Data types,经双方编辑后内容可能与来源不同。