public void setValue(int x, int y, int value) { x = x - this.centerX; y = y - this.centerY; if (x < 0 || y < 0 || x >= sideLen || y >= sideLen) { JsUtil.throwError("index out of bounds"); } this.data.$get(x).$set(y, value); }
/** * @param x * @param y * @return */ public boolean hasActiveNeighbour(int x, int y) { x = x - this.centerX; y = y - this.centerY; if (x < 0 || y < 0 || x >= sideLen || y >= sideLen) { JsUtil.throwError("index out of bounds"); } return ((x > 0 && this.data.$get(x - 1).$get(y) > 0) || (y > 0 && this.data.$get(x).$get(y - 1) > 0) || (x < sideLen - 1 && this.data.$get(x + 1).$get(y) > 0) || (y < sideLen - 1 && this.data.$get(x).$get(y + 1) > 0)); }
/** Sends a given action data object into data object and sends it to the game server. */ public void sendMessage(String actionData) { JsUtil.throwError("NotImplementedYetException"); }
/** Parses a message and invokes commands if necessary. */ public void parseMessage(String msg) { JsUtil.throwError("NotImplementedYetException"); }