Skip to content

Instantly share code, notes, and snippets.

@EbbeVang
Created February 22, 2018 06:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EbbeVang/fdc7a15964206b8b0c8edfa0b20a571a to your computer and use it in GitHub Desktop.
Save EbbeVang/fdc7a15964206b8b0c8edfa0b20a571a to your computer and use it in GitHub Desktop.
Engine Interface
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