Пример #1
0
  @Override
  public void doTurn(ImageView imageBoard, int position) {
    if (mHomeView == null) return;

    if (bAllowClick) {
      if (!cardsList.get(position).isMatched())
        if (c1 == null && !cardsList.get(position).isFlipped()) {
          cardsList.get(position).setFlipped(true);
          c1 = cardsList.get(position);
          mHomeView.flipCard(imageBoard, c1.getId());
        } else if (c2 == null && !cardsList.get(position).isFlipped()) {
          cardsList.get(position).setFlipped(true);
          c2 = cardsList.get(position);
          mHomeView.flipCard(imageBoard, c2.getId());

          bAllowClick = false;
          startTimer(1000);
        }
    }
  }
Пример #2
0
  @Override
  public void flipAllCards() {
    if (mHomeView == null) return;

    bAllowClick = false;

    for (int a = 0; a < cardsList.size(); a++)
      mHomeView.flipCard(cardsView.get(a), cardsList.get(a).getId());

    startTimer(3000);
  }