Examples of newId()


Examples of com.hazelcast.core.IdGenerator.newId()

        ServiceReference reference = context.getServiceReference("com.hazelcast.core.HazelcastInstance");
        HazelcastInstance instance = (HazelcastInstance) context.getService(reference);
        context.ungetService(reference);
        try {
            IdGenerator idGenerator = instance.getIdGenerator("cellar-smaple-generator");
            Long id = idGenerator.newId();
            topic = instance.getTopic("cellar-sample-topic");
            topic.addMessageListener(messageListener);
            topic.publish(new Message("id="+id));
        } catch (Exception ex) {
            ex.printStackTrace();
View Full Code Here

Examples of mage.abilities.Ability.newId()

    @Override
    public void addAbility(Ability ability, UUID sourceId, Game game) {
        if (!abilities.containsKey(ability.getId())) {
            Ability copyAbility = ability.copy();
            copyAbility.newId(); // needed so that source can get an ability multiple times (e.g. Raging Ravine)
            copyAbility.setControllerId(controllerId);
            copyAbility.setSourceId(objectId);
            game.getState().addAbility(copyAbility, sourceId, this);
            abilities.add(copyAbility);
        }
View Full Code Here

Examples of mage.abilities.Ability.newId()

        target.getAbilities().clear();

        for (Ability ability0 : sourceObj.getAbilities()) {
            Ability ability = ability0.copy();
            ability.newId();
            ability.setSourceId(target.getId());
            target.addAbility(ability);
        }
        // Needed to do it this way because only the cardValue does not include the increased value from cards like "Intangible Virtue" will be copied.
        target.getPower().initValue(Integer.parseInt(sourceObj.getPower().toString()));
View Full Code Here

Examples of mage.abilities.Ability.newId()

        target.setExpansionSetCode(source.getExpansionSetCode());
        target.getAbilities().clear();

        for (Ability ability0 : source.getAbilities()) {
            Ability ability = ability0.copy();
            ability.newId();
            ability.setSourceId(target.getId());
            if(target instanceof Permanent) {
                ((Permanent)target).addAbility(ability, game);
            } else {
                target.addAbility(ability);
View Full Code Here

Examples of mage.abilities.Ability.newId()

            Ability ability = (Ability) stackAbility.getStackAbility();
            Player controller = game.getPlayer(source.getControllerId());
            Permanent sourcePermanent = game.getPermanent(source.getSourceId());
            if (ability != null && controller != null && sourcePermanent != null) {
                Ability newAbility = ability.copy();
                newAbility.newId();
                game.getStack().push(new StackAbility(newAbility, source.getControllerId()));
                if (newAbility.getTargets().size() > 0) {
                    if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", game)) {
                        newAbility.getTargets().clearChosen();
                        if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) {
View Full Code Here

Examples of mage.abilities.Ability.newId()

        Ability ability = (Ability) getValue("stackAbility");
        Player controller = game.getPlayer(source.getControllerId());
        Permanent sourcePermanent = game.getPermanent(source.getSourceId());
        if (ability != null && controller != null && sourcePermanent != null) {
            Ability newAbility = ability.copy();
            newAbility.newId();
            game.getStack().push(new StackAbility(newAbility, source.getControllerId()));
            if (newAbility.getTargets().size() > 0) {
                if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", game)) {
                    newAbility.getTargets().clearChosen();
                    if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) {
View Full Code Here

Examples of mage.abilities.Ability.newId()

                    Ability ability = (Ability) getValue("stackAbility");
                    Player controller = game.getPlayer(source.getControllerId());
                    Permanent sourcePermanent = game.getPermanent(source.getSourceId());
                    if (ability != null && controller != null) {
                        Ability newAbility = ability.copy();
                        newAbility.newId();
                        game.getStack().push(new StackAbility(newAbility, source.getControllerId()));
                        if (newAbility.getTargets().size() > 0) {
                            if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", game)) {
                                newAbility.getTargets().clearChosen();
                                if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) {
View Full Code Here

Examples of mage.abilities.Ability.newId()

                    Ability ability = (Ability) getValue("stackAbility");
                    Player controller = game.getPlayer(source.getControllerId());
                    Permanent sourcePermanent = game.getPermanent(source.getSourceId());
                    if (ability != null && controller != null) {
                        Ability newAbility = ability.copy();
                        newAbility.newId();
                        game.getStack().push(new StackAbility(newAbility, source.getControllerId()));
                        if (newAbility.getTargets().size() > 0) {
                            if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", game)) {
                                newAbility.getTargets().clearChosen();
                                if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) {
View Full Code Here

Examples of mage.abilities.DelayedTriggeredAbility.newId()

  }
 
  @Override
  public void addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility) {
    DelayedTriggeredAbility newAbility = (DelayedTriggeredAbility) delayedAbility.copy();
    newAbility.newId();
    state.addDelayedTriggeredAbility(newAbility);
  }

  @Override
  public boolean checkStateAndTriggered() {
View Full Code Here

Examples of mage.abilities.DelayedTriggeredAbility.newId()

    }

    @Override
    public void addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility) {
        DelayedTriggeredAbility newAbility = delayedAbility.copy();
        newAbility.newId();
        newAbility.init(this);
        state.addDelayedTriggeredAbility(newAbility);
    }

    @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.