Exemplo n.º 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);
  }
Exemplo n.º 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));
  }
Exemplo n.º 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");
 }
Exemplo n.º 4
0
 /** Parses a message and invokes commands if necessary. */
 public void parseMessage(String msg) {
   JsUtil.throwError("NotImplementedYetException");
 }