forked from Team254/FRC-2019-Public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Action.java
33 lines (29 loc) · 996 Bytes
/
Action.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.team254.frc2019.auto.actions;
/**
* Action Interface, an interface that describes an iterative action. It is run by an autonomous action, called by the
* method runAction in AutoModeBase (or more commonly in autonomous modes that extend AutoModeBase)
*
* @see com.team254.frc2019.auto.modes.AutoModeBase#runAction
*/
public interface Action {
/**
* Run code once when the action is started, for setup
*/
void start();
/**
* Called by runAction in AutoModeBase iteratively until isFinished returns true. Iterative logic lives in this
* method
*/
void update();
/**
* Returns whether or not the code has finished execution. When implementing this interface, this method is used by
* the runAction method every cycle to know when to stop running the action
*
* @return boolean
*/
boolean isFinished();
/**
* Run code once when the action finishes, usually for clean up
*/
void done();
}