예제 #1
0
  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);
  }
예제 #2
0
  /**
   * @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));
  }
예제 #3
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");
 }
예제 #4
0
 /** Parses a message and invokes commands if necessary. */
 public void parseMessage(String msg) {
   JsUtil.throwError("NotImplementedYetException");
 }