Advertisement
Guest User

Untitled

a guest
May 23rd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.43 KB | None | 0 0
  1. package ZoneCraftClient.Board;
  2.  
  3. import ZoneCraftClient.InputEvent;
  4. import ZoneCraftClient.InputType;
  5. import ZoneCraftClient.ZoneCraftClient;
  6.  
  7. /**
  8.  * Describes the functionality need for front-end.
  9.  *
  10.  * @author Johu
  11.  */
  12. public abstract class Board {
  13.     /**
  14.      * Gamestate
  15.      */
  16.     GameStates gameState = GameStates.NOT_STARTED;
  17.     ZoneCraftClient frontEnd; /**< used to create events */
  18.    
  19.     Board(ZoneCraftClient frontEnd) {
  20.         this.frontEnd = frontEnd;      
  21.     }
  22.    
  23.     // TODO täienda klassi vajalike muutujate ja funktsioonidega
  24.    
  25.     /**
  26.      * Sets the dot on the board.
  27.      * @param x coordinate to be set
  28.      * @param y coordinate to be set
  29.      * @param brush_h size of the brush
  30.      * @param brush_w size of the brush
  31.      * @param owner of the specified dot (who has the dot on specified crossing)
  32.      * @param occupant of the specified dot (who controls the area)
  33.      * @param flags - if first byte should be 1 the dot is some border. We don't care about other right now
  34.      */
  35.     protected abstract void setDot(int x, int y, int brush_h, int brush_w, byte owner, byte occupant, byte flags, byte other);
  36.     /**
  37.      * Gives out the coordinates of player selected dot. It dosn't have to be valid. If it is valid, server will
  38.      * send new dot for this position.
  39.      * @param x coordinate of dot candidate
  40.      * @param y coordinate of dot candidate
  41.      */
  42.     protected void sendMove(int x, int y) {
  43.         frontEnd.inputEvent(new InputEvent(InputType.MOVE, x+" "+y));      
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement