C# Класс TrafficManager.Traffic.SpeedLimitManager

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
AvailableSpeedLimits List

Открытые методы

Метод Описание
GetAverageDefaultCustomSpeedLimit ( NetInfo segmentInfo, NetInfo dir = null ) : ushort

Determines the average default speed limit for a given NetInfo object in terms of discrete speed limit levels. An in-game speed limit of 2.0 (e.g. on highway) is hereby translated into a discrete speed limit value of 100 (km/h).

GetCustomSpeedLimit ( uint laneId ) : ushort

Determines the currently set speed limit for the given lane in terms of discrete speed limit levels. An in-game speed limit of 2.0 (e.g. on highway) is hereby translated into a discrete speed limit value of 100 (km/h).

GetCustomSpeedLimit ( ushort segmentId, NetInfo dir ) : ushort

Determines the currently set speed limit for the given segment and lane direction in terms of discrete speed limit levels. An in-game speed limit of 2.0 (e.g. on highway) is hereby translated into a discrete speed limit value of 100 (km/h).

GetDefaultSpeedLimits ( ) : ushort>.Dictionary
GetGameSpeedLimit ( uint laneId ) : float

Determines the currently set speed limit for the given lane in terms of game (floating point) speed limit levels

SetSpeedLimit ( ushort segmentId, NetInfo dir, ushort speedLimit ) : bool

Sets the speed limit of a given segment and lane direction.

ToCustomSpeedLimit ( float gameSpeedLimit ) : ushort

Converts a game speed limit to a custom speed limit.

ToGameSpeedLimit ( ushort customSpeedLimit ) : float

Converts a custom speed limit to a game speed limit.

Приватные методы

Метод Описание
GetLockFreeGameSpeedLimit ( ushort segmentId, uint laneIndex, uint laneId, NetInfo laneInfo ) : float
SpeedLimitManager ( ) : ColossalFramework

Описание методов

GetAverageDefaultCustomSpeedLimit() публичный статический Метод

Determines the average default speed limit for a given NetInfo object in terms of discrete speed limit levels. An in-game speed limit of 2.0 (e.g. on highway) is hereby translated into a discrete speed limit value of 100 (km/h).
public static GetAverageDefaultCustomSpeedLimit ( NetInfo segmentInfo, NetInfo dir = null ) : ushort
segmentInfo NetInfo
dir NetInfo
Результат ushort

GetCustomSpeedLimit() публичный статический Метод

Determines the currently set speed limit for the given lane in terms of discrete speed limit levels. An in-game speed limit of 2.0 (e.g. on highway) is hereby translated into a discrete speed limit value of 100 (km/h).
public static GetCustomSpeedLimit ( uint laneId ) : ushort
laneId uint
Результат ushort

GetCustomSpeedLimit() публичный статический Метод

Determines the currently set speed limit for the given segment and lane direction in terms of discrete speed limit levels. An in-game speed limit of 2.0 (e.g. on highway) is hereby translated into a discrete speed limit value of 100 (km/h).
public static GetCustomSpeedLimit ( ushort segmentId, NetInfo dir ) : ushort
segmentId ushort
dir NetInfo
Результат ushort

GetDefaultSpeedLimits() публичный статический Метод

public static GetDefaultSpeedLimits ( ) : ushort>.Dictionary
Результат ushort>.Dictionary

GetGameSpeedLimit() публичный статический Метод

Determines the currently set speed limit for the given lane in terms of game (floating point) speed limit levels
public static GetGameSpeedLimit ( uint laneId ) : float
laneId uint
Результат float

SetSpeedLimit() публичный статический Метод

Sets the speed limit of a given segment and lane direction.
public static SetSpeedLimit ( ushort segmentId, NetInfo dir, ushort speedLimit ) : bool
segmentId ushort
dir NetInfo
speedLimit ushort
Результат bool

ToCustomSpeedLimit() публичный статический Метод

Converts a game speed limit to a custom speed limit.
public static ToCustomSpeedLimit ( float gameSpeedLimit ) : ushort
gameSpeedLimit float
Результат ushort

ToGameSpeedLimit() публичный статический Метод

Converts a custom speed limit to a game speed limit.
public static ToGameSpeedLimit ( ushort customSpeedLimit ) : float
customSpeedLimit ushort
Результат float

Описание свойств

AvailableSpeedLimits публичное статическое свойство

public static List AvailableSpeedLimits
Результат List