C# Class TrafficManager.Traffic.TrafficPriority

Afficher le fichier Open project: Katalyst6/CSL.TransitAddonMod Class Usage Examples

Méthodes publiques

Свойство Type Description
PrioritySegments TrafficSegment[]
markedVehicles HashSet[]
maxStopVelocity float

Méthodes publiques

Méthode Description
AddPrioritySegment ( ushort nodeId, ushort segmentId, SegmentEnd type ) : void
GetPrioritySegment ( ushort nodeId, ushort segmentId ) : SegmentEnd
GetPrioritySegmentIds ( ushort nodeId ) : List
GetSegmentDir ( int segment, ushort nodeid ) : Vector3
GetVehiclePosition ( ushort vehicleId ) : VehiclePosition
HasIncomingVehiclesWithHigherPriority ( ushort targetVehicleId, ushort nodeId ) : bool
IsLaneOrderConflictFree ( ushort segmentId, uint leftLaneIndex, uint rightLaneIndex ) : bool
IsLeftHandDrive ( ) : bool

Determines if the map uses a left-hand traffic system

IsLeftSegment ( ushort fromSegment, ushort toSegment, ushort nodeid ) : bool
IsPriorityNode ( ushort nodeId ) : bool
IsPrioritySegment ( ushort nodeId, ushort segmentId ) : bool
IsRightSegment ( ushort fromSegment, ushort toSegment, ushort nodeid ) : bool
RemovePrioritySegments ( ushort nodeId ) : void
TrafficLightSimulationStep ( ) : void
getPriorityNodes ( ) : HashSet
nodeHousekeeping ( ushort nodeId ) : void
segmentHousekeeping ( ushort segmentId ) : void

Méthodes protégées

Méthode Description
HasVehiclePriority ( bool debug, ushort targetCarId, bool targetIsOnMainRoad, ushort incomingCarId, bool incomingIsOnMainRoad, ushort nodeId ) : bool

Private Methods

Méthode Description
AddPriorityNode ( ushort nodeId ) : byte

Adds/Sets a node as a priority node

AddVehicle ( ushort vehicleId, VehiclePosition vehiclePos ) : void
ClearTraffic ( ) : void
HandleAllVehicles ( ) : void
InvertLeftRight ( Direction dir ) : Direction
MarkVehicleInSegment ( ushort vehicleId, ushort segmentId ) : void
OnLevelLoading ( ) : void
OnLevelUnloading ( ) : void
RemovePrioritySegment ( ushort nodeId, ushort segmentId ) : void
RemoveVehicleFromSegments ( ushort vehicleId ) : void
RequestClearTraffic ( ) : void
TrafficPriority ( ) : System
UnmarkVehicleInSegment ( ushort vehicleId, ushort segmentId ) : void
fixJunctions ( ) : void
isValidPriorityNode ( ushort nodeId, NodeValidityState &nodeState ) : bool
rebuildPriorityNodes ( ) : void

rebuilds the implicitly defined set of priority nodes (traffic light nodes & nodes with priority signs)

Method Details

AddPrioritySegment() public static méthode

public static AddPrioritySegment ( ushort nodeId, ushort segmentId, SegmentEnd type ) : void
nodeId ushort
segmentId ushort
type SegmentEnd
Résultat void

GetPrioritySegment() public static méthode

public static GetPrioritySegment ( ushort nodeId, ushort segmentId ) : SegmentEnd
nodeId ushort
segmentId ushort
Résultat SegmentEnd

GetPrioritySegmentIds() public static méthode

public static GetPrioritySegmentIds ( ushort nodeId ) : List
nodeId ushort
Résultat List

GetSegmentDir() public static méthode

public static GetSegmentDir ( int segment, ushort nodeid ) : Vector3
segment int
nodeid ushort
Résultat Vector3

GetVehiclePosition() public static méthode

public static GetVehiclePosition ( ushort vehicleId ) : VehiclePosition
vehicleId ushort
Résultat VehiclePosition

HasIncomingVehiclesWithHigherPriority() public static méthode

public static HasIncomingVehiclesWithHigherPriority ( ushort targetVehicleId, ushort nodeId ) : bool
targetVehicleId ushort
nodeId ushort
Résultat bool

HasVehiclePriority() protected static méthode

protected static HasVehiclePriority ( bool debug, ushort targetCarId, bool targetIsOnMainRoad, ushort incomingCarId, bool incomingIsOnMainRoad, ushort nodeId ) : bool
debug bool
targetCarId ushort
targetIsOnMainRoad bool
incomingCarId ushort
incomingIsOnMainRoad bool
nodeId ushort
Résultat bool

IsLaneOrderConflictFree() public static méthode

public static IsLaneOrderConflictFree ( ushort segmentId, uint leftLaneIndex, uint rightLaneIndex ) : bool
segmentId ushort
leftLaneIndex uint
rightLaneIndex uint
Résultat bool

IsLeftHandDrive() public static méthode

Determines if the map uses a left-hand traffic system
public static IsLeftHandDrive ( ) : bool
Résultat bool

IsLeftSegment() public static méthode

public static IsLeftSegment ( ushort fromSegment, ushort toSegment, ushort nodeid ) : bool
fromSegment ushort
toSegment ushort
nodeid ushort
Résultat bool

IsPriorityNode() public static méthode

public static IsPriorityNode ( ushort nodeId ) : bool
nodeId ushort
Résultat bool

IsPrioritySegment() public static méthode

public static IsPrioritySegment ( ushort nodeId, ushort segmentId ) : bool
nodeId ushort
segmentId ushort
Résultat bool

IsRightSegment() public static méthode

public static IsRightSegment ( ushort fromSegment, ushort toSegment, ushort nodeid ) : bool
fromSegment ushort
toSegment ushort
nodeid ushort
Résultat bool

RemovePrioritySegments() public static méthode

public static RemovePrioritySegments ( ushort nodeId ) : void
nodeId ushort
Résultat void

TrafficLightSimulationStep() public static méthode

public static TrafficLightSimulationStep ( ) : void
Résultat void

getPriorityNodes() public static méthode

public static getPriorityNodes ( ) : HashSet
Résultat HashSet

nodeHousekeeping() public static méthode

public static nodeHousekeeping ( ushort nodeId ) : void
nodeId ushort
Résultat void

segmentHousekeeping() public static méthode

public static segmentHousekeeping ( ushort segmentId ) : void
segmentId ushort
Résultat void

Property Details

PrioritySegments public_oe static_oe property

Dictionary of segments that are connected to roads with timed traffic lights or priority signs. Index: segment id
public static TrafficSegment[] PrioritySegments
Résultat TrafficSegment[]

markedVehicles public_oe static_oe property

Markers that defined in which segment(s) a vehicle will be in the near future. Index: vehicle id
public static HashSet[] markedVehicles
Résultat HashSet[]

maxStopVelocity public_oe static_oe property

public static float maxStopVelocity
Résultat float