Skip to content

ConditionalPrograms

Ferdinand Calo edited this page Jan 25, 2021 · 4 revisions

ConditionalPrograms is a class containing some predefined conditional TurboList programs.
Please be sure to get familiar with DefaultPrograms before continuing!

Note 1: TurboLists will be called "groups" eventually. Note 2: Do not forget to "import" the class when using it to prevent compile errors.
Note 3: as of writing this, ConditionalPrograms are not available for non-java models yet.

Example on how to use a Conditional Program in a Model Group:

somegroup.addProgram(new ConditionalPrograms.FrontLights().add(DefaultPrograms.GLOW).addElse(DefaultPrograms.RGB_PRIMARY));
//when using more fine tuned imports
othergroup.addPrograms(new BackLights().add(GLOW).addElse(new RGBChannel("channel_id"));

Alternatives for addElse are addOpposite or addNegative, if you would prefer to use them, they work the same.


Here a list with their function & eventual usage:

  • Lights, FrontLights
    • condition is true when vehicle lights are on
  • BackLights, RearLights
    • condition is true when vehicle lights are on or going backwards
  • BrakeLights,
    • condition is true when a vehicle is braking (BasicSystem)
  • FogLights,
    • condition is true when fog lights are on
  • LongLights,
    • condition is true when long lights are on
  • ReverseLights
    • condition is true when the vehicle is reversing (going backwards)
  • LightsFrontForward
    • for trains, true when lights on and going forward
  • LightsFrontBackward
    • for trains, true when lights on and going backward
  • LightsRearForward
    • for trains, true when lights on and going forward
  • LightsRearBackward
    • for trains, true when lights on and going backward
  • TurnSignalLeft, IndicatorLightLeft
    • condition is true when the left turn signal is on or warning lights
  • TurnSignalRight, IndicatorLightRight
    • condition is true when the right turn signal is on or warning lights
  • WarningLights
    • condition is true when the warning/hazard lights are on
  • BackLightsSignalLeft, TailLightsSignalLeft
    • condition is true when the left turn signal is on OR back lights condition
  • BackLightsSignalRight, TailLightsSignalRight
    • condition is true when the right turn signal is on OR back lights condition
  • IDSpecific(String)
    • condition is true when the part category equals the specified string
  • IDSpecificArray(String[])
    • condition is true when the part category equals any of the specified strings
Clone this wiki locally