API
An API is shared code used by opmodes.
An API needs to be initialized with the init function before it can be used. In general, APIs should not have side-effects unless one of their functions is called. init should only be called once per opmode.
If an API requires methods only provided by a LinearOpMode, it must override isLinear and set it to true
. It can then access the linearOpMode property, which is like opMode but casted to the LinearOpMode type.
An API can specify that it depends on another API by overriding the dependencies function and returning a Set of all the APIs it requires. These dependencies will be checked at runtime. It is additionally recommended to document in the comments what APIs your API depends on.