示例#1
0
 /**
  * Sets the owned squares list, notifying the listeners
  *
  * @param ownedSquaresList the list to set
  */
 public static void setOwnedSquaresList(ArrayList<Square> ownedSquaresList) {
   InSquareProfile.ownedSquaresList = ownedSquaresList;
   // Notifica gli ascoltatori
   for (InSquareProfileListener ispl : listeners) {
     ispl.onOwnedChanged();
     Log.d(TAG, "setOwnedSquares: notifying listeners!");
   }
 }
示例#2
0
  /**
   * Adds the square passed as parameter to the list of the owned squares
   *
   * @param square The square you want to add
   */
  public static void addOwned(Square square) {
    // Aggiungi in coda
    ownedSquaresList.add(square);

    // Notifica gli ascoltatori
    for (InSquareProfileListener ispl : listeners) {
      ispl.onOwnedChanged();
      Log.d(TAG, "addOwned: notifying listeners!");
    }
  }
示例#3
0
  /**
   * Removes the square passed as parameter from the list of the owned squares
   *
   * @param square The square you want to remove
   */
  public static void removeOwned(String square) {
    // trova la square da rimuovere
    for (Square s : ownedSquaresList) {
      if (s.getId().equals(square)) {
        ownedSquaresList.remove(s);
        break;
      }
    }

    // Notifica gli ascoltatori
    for (InSquareProfileListener ispl : listeners) {
      ispl.onOwnedChanged();
      Log.d(TAG, "removeOwned: notifying listeners!");
    }
  }