C# Class TrafficManager.Traffic.SpeedLimitManager

Afficher le fichier Open project: Katalyst6/CSL.TransitAddonMod

Méthodes publiques

Свойство Type Description
AvailableSpeedLimits List

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
GetLockFreeGameSpeedLimit ( ushort segmentId, uint laneIndex, uint laneId, NetInfo laneInfo ) : float
SpeedLimitManager ( ) : ColossalFramework

Method Details

GetAverageDefaultCustomSpeedLimit() public static méthode

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
Résultat ushort

GetCustomSpeedLimit() public static méthode

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
Résultat ushort

GetCustomSpeedLimit() public static méthode

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
Résultat ushort

GetDefaultSpeedLimits() public static méthode

public static GetDefaultSpeedLimits ( ) : ushort>.Dictionary
Résultat ushort>.Dictionary

GetGameSpeedLimit() public static méthode

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
Résultat float

SetSpeedLimit() public static méthode

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
Résultat bool

ToCustomSpeedLimit() public static méthode

Converts a game speed limit to a custom speed limit.
public static ToCustomSpeedLimit ( float gameSpeedLimit ) : ushort
gameSpeedLimit float
Résultat ushort

ToGameSpeedLimit() public static méthode

Converts a custom speed limit to a game speed limit.
public static ToGameSpeedLimit ( ushort customSpeedLimit ) : float
customSpeedLimit ushort
Résultat float

Property Details

AvailableSpeedLimits public_oe static_oe property

public static List AvailableSpeedLimits
Résultat List