Feature

public abstract class Feature extends ScriptTemplate

A feature is a type of jlooping script. Like any script, features can be added to a runner at any time and will execute normally in the runner. According to their name, features are designed to be specific featuresnot an entire replacement for an OperationMode. When features are in use, OpModes should add them to the runner in OperationMode.construct via OperationMode.registerFeature and the features should take care of operation of their specific tasks. Features can implement the Buildable interface to mimick OperationMode.construct, and Conditional to only execute when their Conditional.when method returns true. State machines are encouraged to be created via conditional features rather than a switch statement or if/else chain.

Inheritors

Constructors

Link copied to clipboard
public Feature Feature()

Properties

Link copied to clipboard
private ScriptParameters environment
Link copied to clipboard
public final String name
Link copied to clipboard
public final Boolean needsInit

Functions

Link copied to clipboard
public final ScriptParameters getEnvironment()
Link copied to clipboard
public Unit init(ScriptParameters parameters)
Link copied to clipboard
public abstract Unit loop()

The method to run on every loop of this feature. If this feature is conditional, this will only run if Conditional.when returns true.

Link copied to clipboard
public Unit run(ScriptParameters parameters)
Link copied to clipboard
public final Unit setEnvironment(ScriptParameters environment)