Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ZoneCraftClient.Board;
- import ZoneCraftClient.InputEvent;
- import ZoneCraftClient.InputType;
- import ZoneCraftClient.ZoneCraftClient;
- /**
- * Describes the functionality need for front-end.
- *
- * @author Johu
- */
- public abstract class Board {
- /**
- * Gamestate
- */
- GameStates gameState = GameStates.NOT_STARTED;
- ZoneCraftClient frontEnd; /**< used to create events */
- Board(ZoneCraftClient frontEnd) {
- this.frontEnd = frontEnd;
- }
- // TODO täienda klassi vajalike muutujate ja funktsioonidega
- /**
- * Sets the dot on the board.
- * @param x coordinate to be set
- * @param y coordinate to be set
- * @param brush_h size of the brush
- * @param brush_w size of the brush
- * @param owner of the specified dot (who has the dot on specified crossing)
- * @param occupant of the specified dot (who controls the area)
- * @param flags - if first byte should be 1 the dot is some border. We don't care about other right now
- */
- protected abstract void setDot(int x, int y, int brush_h, int brush_w, byte owner, byte occupant, byte flags, byte other);
- /**
- * Gives out the coordinates of player selected dot. It dosn't have to be valid. If it is valid, server will
- * send new dot for this position.
- * @param x coordinate of dot candidate
- * @param y coordinate of dot candidate
- */
- protected void sendMove(int x, int y) {
- frontEnd.inputEvent(new InputEvent(InputType.MOVE, x+" "+y));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement