Created
February 22, 2018 06:20
-
-
Save EbbeVang/fdc7a15964206b8b0c8edfa0b20a571a to your computer and use it in GitHub Desktop.
Engine Interface
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
public interface Engine { | |
/** | |
* starts the engine | |
* @return true if it wasn't already started | |
*/ | |
boolean start(); | |
/** | |
* stops the engine | |
* @return true if it was started | |
*/ | |
boolean stop(); | |
/** | |
* set the engine to move backwards | |
* @return if engine successfully changed (false if already in backwards) | |
*/ | |
boolean backwards(); | |
/** | |
* set the engine to move forward | |
* @return if engine successfully changed (false if already in forwards) | |
*/ | |
boolean Forward(); | |
/** | |
* Drives the engine | |
* @param power the amount of energy you give give the engine. between 0 and 100 | |
* @return speed in km/h | |
*/ | |
double drive(int power); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment