Esempio n. 1
0
  /**
   * Opens a window with the specified listener.
   *
   * @param listener The listener for this interface.
   * @param windowId The window's id.
   */
  public void openWindow(InterfaceListener listener, int windowId) {
    closeAndNotify();
    this.listener = listener;

    interfaces.put(InterfaceType.WINDOW, windowId);

    player.send(new OpenInterfaceEvent(windowId));
  }
Esempio n. 2
0
  /**
   * Opens a window and inventory sidebar with the specified listener.
   *
   * @param listener The listener for this interface.
   * @param windowId The window's id.
   * @param sidebarId The sidebar's id.
   */
  public void openWindowWithSidebar(InterfaceListener listener, int windowId, int sidebarId) {
    closeAndNotify();
    this.listener = listener;

    interfaces.put(InterfaceType.WINDOW, windowId);
    interfaces.put(InterfaceType.SIDEBAR, sidebarId);

    player.send(new OpenInterfaceSidebarEvent(windowId, sidebarId));
  }
Esempio n. 3
0
  public void updateStatistics(final String name, final Number number) {
    mOwner.send(
        new Player.Message(Player.ACTION_UPDATE_HERO_STAT, this) {
          @Override
          public void extra(Parcel m) {
            m.writeString(name);
            m.writeValue(number);
          }
        });

    Log.v(TAG, "cannot found");
  }
Esempio n. 4
0
  public Hero(Player owner, String name) {
    mOwner = owner;
    mName = name;

    mOwner.send(
        new Player.Message(Player.ACTION_GET_HERO) {
          @Override
          public void extra(Parcel m) {
            m.writeString(mName);
          }
        });

    notifyChanged();
  }
Esempio n. 5
0
  /**
   * Opens the enter amount dialog.
   *
   * @param listener The enter amount listener.
   */
  public void openEnterAmountDialog(EnterAmountListener listener) {
    this.amountListener = listener;

    player.send(new EnterAmountEvent());
  }
Esempio n. 6
0
  /** Closes the current open interface(s). */
  public void close() {
    closeAndNotify();

    player.send(new CloseInterfaceEvent());
  }