Examples of removeAttachment()


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

                if (target.choose(Outcome.Neutral, source.getControllerId(), source.getSourceId(), game)) {
                    Permanent equipmentPermanent = game.getPermanent(target.getFirstTarget());
                    if (equipmentPermanent != null) {
                        Permanent attachedTo = game.getPermanent(equipmentPermanent.getAttachedTo());
                        if (attachedTo != null) {
                            attachedTo.removeAttachment(equipmentPermanent.getId(), game);
                        }
                        tokenPermanent.addAttachment(equipmentPermanent.getId(), game);
                    }
                }
            }
View Full Code Here

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

            if (player.choose(Outcome.Benefit, targetAura, source.getSourceId(), game)) {
                Permanent aura = game.getPermanent(targetAura.getFirstTarget());
                if (aura != null) {
                    Permanent attachedTo = game.getPermanent(aura.getAttachedTo());
                    if (attachedTo != null) {
                        attachedTo.removeAttachment(aura.getId(), game);
                    }
                    permanent.addAttachment(aura.getId(), game);
                }
            }
        }
View Full Code Here

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

        if (you != null && opponentCreature != null && prisonTerm != null) {
            Permanent oldCreature = game.getPermanent(prisonTerm.getAttachedTo());
            if (oldCreature == null) {
                return false;
            }
            if (oldCreature.removeAttachment(prisonTerm.getId(), game)) {
                return opponentCreature.addAttachment(prisonTerm.getId(), game);
            }
        }
        return false;
    }
View Full Code Here

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

            Permanent attachment = game.getPermanent(source.getSourceId());
            if (permanent != null && attachment != null) {
                if (attachment.getAttachedTo() != null) {
                    Permanent oldTarget = game.getPermanent(attachment.getAttachedTo());
                    if (oldTarget != null) {
                        oldTarget.removeAttachment(source.getSourceId(), game);
                    }
                }
                boolean result;
                result = permanent.addAttachment(source.getSourceId(), game);
                return result;
View Full Code Here

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

        if (aura != null && creature != null) {
            Permanent oldCreature = game.getPermanent(aura.getAttachedTo());
            if (oldCreature == null || oldCreature.equals(creature)) {
                return false;
            }
            if (oldCreature.removeAttachment(aura.getId(), game)) {
                return creature.addAttachment(aura.getId(), game);
            }
        }
        return false;
    }
View Full Code Here

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

        if (equipmentId != null) {
            Permanent equipment = game.getPermanent(equipmentId);
            if (equipment != null && equipment.getAttachedTo() != null) {
                Permanent attachedTo = game.getPermanent(equipment.getAttachedTo());
                if (attachedTo != null) {
                    attachedTo.removeAttachment(equipmentId, game);
                }
            }
            return true;
        }
        return false;
View Full Code Here

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

    @Override
    public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
        Permanent attachment = game.getPermanent(sourceId);
        Permanent permanent = game.getPermanent(attachment.getAttachedTo());
        if (permanent != null) {
            paid = permanent.removeAttachment(attachment.getId(), game);
            if (paid) {
                game.fireEvent(GameEvent.getEvent(GameEvent.EventType.UNATTACHED, sourceId, sourceId, controllerId));
            }
        }
        return paid;
View Full Code Here

Examples of org.apache.axis2.context.MessageContext.removeAttachment()

    public OMElement echoOMElement(OMElement omEle) throws AxisFault {
        OMElement child = (OMElement)omEle.getFirstOMChild();
        MessageContext msgCtx = MessageContext.getCurrentMessageContext();
        Attachments attachment = (msgCtx).getAttachmentMap();
        msgCtx.removeAttachment(attachment.getSOAPPartContentID());
        msgCtx.getOperationContext().getMessageContext(
                WSDLConstants.MESSAGE_LABEL_OUT_VALUE).setAttachmentMap(attachment);

        omEle.build();
        return omEle;
View Full Code Here

Examples of org.apache.servicemix.nmr.api.Message.removeAttachment()

    }

    public void testAttachments() {
        Message msg = new MessageImpl();
        assertNull(msg.getAttachment("id"));
        msg.removeAttachment("id");
        assertNotNull(msg.getAttachments());
        assertNull(msg.getAttachment("id"));
        msg.addAttachment("id", "value");
        assertEquals("value", msg.getAttachment("id"));
        msg.removeAttachment("id");
View Full Code Here

Examples of org.apache.servicemix.nmr.api.Message.removeAttachment()

        msg.removeAttachment("id");
        assertNotNull(msg.getAttachments());
        assertNull(msg.getAttachment("id"));
        msg.addAttachment("id", "value");
        assertEquals("value", msg.getAttachment("id"));
        msg.removeAttachment("id");
        assertNull(msg.getAttachment("id"));
        assertTrue(msg.getAttachments().isEmpty());
    }

    public void testCopy() {
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.