C# Class TrafficManager.Traffic.SpeedLimitManager

显示文件 Open project: Katalyst6/CSL.TransitAddonMod

Public Properties

Property Type Description
AvailableSpeedLimits List

Public Methods

Method 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

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

Method Details

GetAverageDefaultCustomSpeedLimit() public static method

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
return ushort

GetCustomSpeedLimit() public static method

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
return ushort

GetCustomSpeedLimit() public static method

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
return ushort

GetDefaultSpeedLimits() public static method

public static GetDefaultSpeedLimits ( ) : ushort>.Dictionary
return ushort>.Dictionary

GetGameSpeedLimit() public static method

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
return float

SetSpeedLimit() public static method

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
return bool

ToCustomSpeedLimit() public static method

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

ToGameSpeedLimit() public static method

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

Property Details

AvailableSpeedLimits public_oe static_oe property

public static List AvailableSpeedLimits
return List