Examples of addCounters()


Examples of com.hbasebook.hush.model.ShortUrlStatistics.addCounters()

    manager.putTable(table);

    ShortUrlStatistics statistics = new ShortUrlStatistics(shortUrl,
      TimeFrame.DAY);
    statistics.addCounters("clicks", clicks);
    statistics.addCounters("clicksbycountry",
      new TreeSet<Counter<String, Long>>(clicksByCountry.values()));
    return statistics;
  }
View Full Code Here

Examples of mage.cards.Card.addCounters()

            }
            if (card.moveToExile(exileId, new StringBuilder("Suspended cards of ").append(controller.getName()).toString() , source.getSourceId(), game)) {
                if (suspend == Integer.MAX_VALUE) {
                    suspend = source.getManaCostsToPay().getX();
                }
                card.addCounters(CounterType.TIME.createInstance(suspend), game);
                game.informPlayers(new StringBuilder(controller.getName()).append(" suspends (").append(suspend).append(") ").append(card.getName()).toString());
                return true;
            }
        }
        return false;
View Full Code Here

Examples of mage.cards.Card.addCounters()

                    int countersToAdd = amount.calculate(game, source, this);
                    if (countersToAdd > 0 && newCounter.getCount() == 1) {
                        countersToAdd--;
                    }
                    newCounter.add(countersToAdd);
                    card.addCounters(newCounter, game);
                    if (informPlayers) {
                        Player player = game.getPlayer(source.getControllerId());
                        if (player != null) {
                            game.informPlayers(new StringBuilder(player.getName()).append(" puts ").append(newCounter.getCount()).append(" ").append(newCounter.getName().toLowerCase()).append(" counter on ").append(card.getLogName()).toString());
                        }
View Full Code Here

Examples of mage.cards.Card.addCounters()

            if (exileId == null) {
                exileId = UUID.randomUUID();
                game.getState().setValue("SuspendExileId" + source.getControllerId().toString(), exileId);
            }
            if (card.moveToExile(exileId, new StringBuilder("Suspended cards of ").append(controller.getName()).toString() , source.getSourceId(), game)) {
                card.addCounters(CounterType.TIME.createInstance(4), game);
                if (!hasSuspend) {
                    // add suspend ability
                    // TODO: Find a better solution for giving suspend to a card.
                    // If the exiled card leaves exile by another way, the abilites won't be removed from the card
                    Abilities oldAbilities = card.getAbilities().copy();
View Full Code Here

Examples of mage.game.permanent.Permanent.addCounters()

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getSourceId());
    if (permanent != null) {
      permanent.addCounters(new PlusOneCounter(amount));
    }
    return true;
  }

  @Override
View Full Code Here

Examples of mage.game.permanent.Permanent.addCounters()

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getSourceId());
    if (permanent != null) {
      permanent.addCounters(name, amount);
    }
    return true;
  }

  @Override
View Full Code Here

Examples of mage.game.permanent.Permanent.addCounters()

  public boolean apply(Game game, Ability source) {
    Permanent enchantment = game.getPermanent(source.getSourceId());
    if (enchantment != null && enchantment.getAttachedTo() != null) {
      Permanent creature = game.getPermanent(enchantment.getAttachedTo());
      if (creature != null) {
        creature.addCounters(new PlusOneCounter(amount));
      }
    }
    return true;
  }
View Full Code Here

Examples of mage.game.permanent.Permanent.addCounters()

      if (target.canChoose(null, source.getControllerId(), game)) {
        target.setRequired(true);
        if (player.choose(Outcome.Neutral, target, game)) {
          Permanent permanent = game.getPermanent(target.getFirstTarget());
          if (permanent != null) {
            permanent.addCounters("phylactery", 1);
          }
        }
      }
    }
    return false;
View Full Code Here

Examples of mage.game.permanent.Permanent.addCounters()

    @Override
    public boolean apply(Game game, Ability source) {
      Permanent permanent = game.getPermanent(source.getSourceId());
      if (permanent != null) {
        int amount = source.getManaCosts().getVariableCosts().get(0).getAmount();
        permanent.addCounters(new PlusOneCounter(amount));
      }
      return true;
    }

    @Override
View Full Code Here

Examples of mage.game.permanent.Permanent.addCounters()

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      permanent.addCounters(name, amount);
    }
    return true;
  }

  @Override
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.