AtkinsSJ

Untitled

May 16th, 2013
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.82 KB | None | 0 0
  1. package uk.co.samatkins.racing.drivers;
  2.  
  3. import uk.co.samatkins.racing.Car;
  4. import uk.co.samatkins.racing.Move;
  5.  
  6. public interface Driver {
  7.    
  8.     /**
  9.      * Tell this Driver to control the given car.
  10.      * @param car - The Car this Driver controls
  11.      */
  12.     public void setCar(Car car);
  13.    
  14.     /**
  15.      * Tell this Driver to start calculating its next move.
  16.      *
  17.      * AI drivers should start a thread for this, whereas a player
  18.      * one should enable the UI.
  19.      */
  20.     public void calculateMove();
  21.    
  22.     /**
  23.      * @return Whether this Driver is ready to make a move this turn.
  24.      */
  25.     public boolean isReady();
  26.    
  27.     /**
  28.      * @return The Move for this turn.
  29.      */
  30.     public Move getMove();
  31.    
  32.     /**
  33.      * Called each physics step. Should just update the car's steering
  34.      * braking and acceleration with the Move's values.
  35.      */
  36.     public void drive();
  37. }
Advertisement
Add Comment
Please, Sign In to add comment