C# Class TrafficManager.Custom.AI.CustomRoadAI

Inheritance: RoadBaseAI
Show file Open project: Katalyst6/CSL.TransitAddonMod Class Usage Examples

Public Properties

Property Type Description
InStartupPhase bool
currentLaneDensities uint[]
currentLaneSpeeds uint[]
currentLaneTrafficBuffer ushort[]
initDone bool
laneMeanSpeeds byte[]
simStartFrame uint

Public Methods

Method Description
Awake ( ) : void
CustomNodeSimulationStep ( ushort nodeId, NetNode &data ) : void
CustomSegmentSimulationStep ( ushort segmentID, NetSegment &data ) : void
CustomSetTrafficLightState ( ushort nodeID, NetSegment &segmentData, uint frame, RoadBaseAI vehicleLightState, RoadBaseAI pedestrianLightState, bool vehicles, bool pedestrians ) : void
GetTrafficLightState ( ushort vehicleId, Vehicle &vehicleData, ushort nodeId, ushort fromSegmentId, ushort toSegmentId, NetSegment &segmentData, uint frame, RoadBaseAI &vehicleLightState, RoadBaseAI &pedestrianLightState ) : void
GetTrafficLightState ( ushort vehicleId, Vehicle &vehicleData, ushort nodeId, ushort fromSegmentId, ushort toSegmentId, NetSegment &segmentData, uint frame, RoadBaseAI &vehicleLightState, RoadBaseAI &pedestrianLightState, bool &vehicles, bool &pedestrians ) : void
OriginalSetTrafficLightState ( bool customCall, ushort nodeID, NetSegment &segmentData, uint frame, RoadBaseAI vehicleLightState, RoadBaseAI pedestrianLightState, bool vehicles, bool pedestrians ) : void
OriginalSimulationStep ( ushort nodeID, NetNode &data ) : void
OriginalSimulationStep ( ushort segmentID, NetSegment &data ) : void
Update ( ) : void

Private Methods

Method Description
AddTraffic ( uint laneID, ushort vehicleLength, ushort speed, bool realTraffic ) : void
GetCustomTrafficLightState ( ushort vehicleId, Vehicle &vehicleData, ushort nodeId, ushort fromSegmentId, ushort toSegmentId, RoadBaseAI &vehicleLightState, RoadBaseAI &pedestrianLightState, TrafficLightSimulation nodeSim = null ) : void
GetSegmentGeometry ( ushort segmentId ) : TrafficManager.Custom.Misc.SegmentGeometry
GetSegmentGeometry ( ushort segmentId, ushort nodeId ) : TrafficManager.Custom.Misc.SegmentGeometry
OnBeforeLoadData ( ) : void
OnLevelUnloading ( ) : void
resetTrafficStats ( ) : void

Method Details

Awake() public method

public Awake ( ) : void
return void

CustomNodeSimulationStep() public method

public CustomNodeSimulationStep ( ushort nodeId, NetNode &data ) : void
nodeId ushort
data NetNode
return void

CustomSegmentSimulationStep() public method

public CustomSegmentSimulationStep ( ushort segmentID, NetSegment &data ) : void
segmentID ushort
data NetSegment
return void

CustomSetTrafficLightState() public static method

public static CustomSetTrafficLightState ( ushort nodeID, NetSegment &segmentData, uint frame, RoadBaseAI vehicleLightState, RoadBaseAI pedestrianLightState, bool vehicles, bool pedestrians ) : void
nodeID ushort
segmentData NetSegment
frame uint
vehicleLightState RoadBaseAI
pedestrianLightState RoadBaseAI
vehicles bool
pedestrians bool
return void

GetTrafficLightState() public static method

public static GetTrafficLightState ( ushort vehicleId, Vehicle &vehicleData, ushort nodeId, ushort fromSegmentId, ushort toSegmentId, NetSegment &segmentData, uint frame, RoadBaseAI &vehicleLightState, RoadBaseAI &pedestrianLightState ) : void
vehicleId ushort
vehicleData Vehicle
nodeId ushort
fromSegmentId ushort
toSegmentId ushort
segmentData NetSegment
frame uint
vehicleLightState RoadBaseAI
pedestrianLightState RoadBaseAI
return void

GetTrafficLightState() public static method

public static GetTrafficLightState ( ushort vehicleId, Vehicle &vehicleData, ushort nodeId, ushort fromSegmentId, ushort toSegmentId, NetSegment &segmentData, uint frame, RoadBaseAI &vehicleLightState, RoadBaseAI &pedestrianLightState, bool &vehicles, bool &pedestrians ) : void
vehicleId ushort
vehicleData Vehicle
nodeId ushort
fromSegmentId ushort
toSegmentId ushort
segmentData NetSegment
frame uint
vehicleLightState RoadBaseAI
pedestrianLightState RoadBaseAI
vehicles bool
pedestrians bool
return void

OriginalSetTrafficLightState() public static method

public static OriginalSetTrafficLightState ( bool customCall, ushort nodeID, NetSegment &segmentData, uint frame, RoadBaseAI vehicleLightState, RoadBaseAI pedestrianLightState, bool vehicles, bool pedestrians ) : void
customCall bool
nodeID ushort
segmentData NetSegment
frame uint
vehicleLightState RoadBaseAI
pedestrianLightState RoadBaseAI
vehicles bool
pedestrians bool
return void

OriginalSimulationStep() public method

public OriginalSimulationStep ( ushort nodeID, NetNode &data ) : void
nodeID ushort
data NetNode
return void

OriginalSimulationStep() public method

public OriginalSimulationStep ( ushort segmentID, NetSegment &data ) : void
segmentID ushort
data NetSegment
return void

Update() public method

public Update ( ) : void
return void

Property Details

InStartupPhase public static property

public static bool InStartupPhase
return bool

currentLaneDensities public static property

public static uint[] currentLaneDensities
return uint[]

currentLaneSpeeds public static property

public static uint[] currentLaneSpeeds
return uint[]

currentLaneTrafficBuffer public static property

public static ushort[] currentLaneTrafficBuffer
return ushort[]

initDone public static property

public static bool initDone
return bool

laneMeanSpeeds public static property

public static byte[] laneMeanSpeeds
return byte[]

simStartFrame public static property

public static uint simStartFrame
return uint