Just some git/project related things:
I recommend you name your project something that includes the year and/or game. If you're going to be making another robot program next year, having separate names will allow you to store both projects on GitHub. For example, naming it PLS5618-Stronghold-2016 will allow you to make another project next year: PLS5618-WaterGame-2017
Make sure you allow your .gitignore to take effect. On your local copy of the project, commit anything if necessary, then run
Code:
git rm -r --cached .
git add .
git commit -a -m "Untrack gitignored files"
---
Instead of having the command pair InBallon/OutBallon, which are very similar, I think it makes more sense to have a single command handle both, eg
Code:
public class MoveBall extends Command {
public enum MoveBallDirection {
IN,
OUT
}
MoveBallDirection whichDirection;
public MoveBall (MoveBallDirection whichDirection) {
requires(Robot.pelle);
this.whichDirection = whichDirection;
}
protected void initialize() {
}
protected void execute() {
if (whichDirection == MoveBallDirection.OUT) {
Robot.pelle.outBallon();
} else {
Robot.pelle.inBallon();
}
Timer.delay(0.08);
}
protected boolean isFinished() {
if (whichDirection == MoveBallDirection.OUT) {
return !Robot.oi.stick.getRawButton(4);
} else {
return Robot.pelle.limitFond();
}
}
}
Similarly, you could even refactor Pelle.in/outBallon into a single function.