-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Noah Gleason
committed
Nov 3, 2017
1 parent
ac456c7
commit aa28f89
Showing
8 changed files
with
144 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...IO/src/main/java/org/usfirst/frc/team449/robot/generalInterfaces/updatable/Updatable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
RoboRIO/src/main/java/org/usfirst/frc/team449/robot/other/Updater.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package org.usfirst.frc.team449.robot.other; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonIdentityInfo; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.ObjectIdGenerators; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.usfirst.frc.team449.robot.generalInterfaces.updatable.Updatable; | ||
import org.usfirst.frc.team449.robot.jacksonWrappers.MappedRunnable; | ||
|
||
/** | ||
* A Runnable for updating cached variables. | ||
*/ | ||
@JsonIdentityInfo(generator = ObjectIdGenerators.StringIdGenerator.class) | ||
public class Updater implements MappedRunnable{ | ||
|
||
/** | ||
* The objects to update. | ||
*/ | ||
@NotNull | ||
private final Updatable[] updatables; | ||
|
||
/** | ||
* Default constructor | ||
* | ||
* @param updatables The objects to update. | ||
*/ | ||
@JsonCreator | ||
public Updater(@NotNull @JsonProperty(required = true) Updatable[] updatables) { | ||
this.updatables = updatables; | ||
} | ||
|
||
/** | ||
* Update all the updatables. | ||
*/ | ||
@Override | ||
public void run() { | ||
for (Updatable updatable : updatables){ | ||
updatable.update(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters