crossing_signal
Pedestrian crossing signal for tram
Vars | |
amber_distance_threshold | Proximity threshold for amber warning (slow people may be in danger) |
---|---|
red_distance_threshold | Proximity threshold for red warning (running people will likely not be able to cross) |
signal_state | green, amber, or red. |
tram_id | The ID of the tram we control |
tram_ref | Weakref to the tram piece we control |
Procs | |
find_tram | Finds the tram, just like the tram computer |
on_tram_travelling | Only process if the tram is actually moving |
set_signal_state | Set the signal state and update appearance. |
update_operating | Update processing state. |
Var Details
amber_distance_threshold
Proximity threshold for amber warning (slow people may be in danger)
red_distance_threshold
Proximity threshold for red warning (running people will likely not be able to cross)
signal_state
green, amber, or red.
tram_id
The ID of the tram we control
tram_ref
Weakref to the tram piece we control
Proc Details
find_tram
Finds the tram, just like the tram computer
Locates tram parts in the lift global list after everything is done.
on_tram_travelling
Only process if the tram is actually moving
set_signal_state
Set the signal state and update appearance.
Arguments: new_state - the new state (XING_STATE_RED, etc) force_update - force appearance to update even if state didn't change.
update_operating
Update processing state.
Returns whether we are still processing.