Examples of EntityAction


Examples of megamek.common.actions.EntityAction

        g.drawPolygon(xPoints, yPoints, 4);

        // if this is mutual fire, draw a half-and-half line
        for (Enumeration<EntityAction> iter = m_game.getActions(); iter
                .hasMoreElements();) {
            EntityAction action = iter.nextElement();
            if (action instanceof AttackAction) {
                AttackAction otherAttack = (AttackAction) action;
                if (attack.getEntityId() == otherAttack.getTargetId()
                        && otherAttack.getEntityId() == attack.getTargetId()) {
                    // attackTarget _must_ be an entity since it's shooting back
View Full Code Here

Examples of megamek.common.actions.EntityAction

    public void removeActionsFor(int entityId) {
        // or rather, only keeps actions NOT by that entity
        Vector<EntityAction> toKeep = new Vector<EntityAction>(actions.size());
        for (Enumeration<EntityAction> i = actions.elements(); i
                .hasMoreElements();) {
            EntityAction ea = i.nextElement();
            if (ea.getEntityId() != entityId) {
                toKeep.addElement(ea);
            }
        }
        actions = toKeep;
    }
View Full Code Here

Examples of megamek.common.actions.EntityAction

    private void resolveAllButWeaponAttacks() {

        Vector<EntityAction> triggerPodActions = new Vector<EntityAction>();
        // loop thru actions and handle everything we expect except attacks
        for (Enumeration<EntityAction> i = game.getActions(); i.hasMoreElements();) {
            EntityAction ea = i.nextElement();
            Entity entity = game.getEntity(ea.getEntityId());
            if (ea instanceof TorsoTwistAction) {
                TorsoTwistAction tta = (TorsoTwistAction) ea;
                if (entity.canChangeSecondaryFacing()) {
                    entity.setSecondaryFacing(tta.getFacing());
                }
View Full Code Here

Examples of megamek.common.actions.EntityAction

     * Called during the fire phase to resolve all (and only) weapon attacks
     */
    private void resolveOnlyWeaponAttacks() {
        // loop thru received attack actions, getting attack handlers
        for (Enumeration<EntityAction> i = game.getActions(); i.hasMoreElements();) {
            EntityAction ea = i.nextElement();
            if (ea instanceof WeaponAttackAction) {
                WeaponAttackAction waa = (WeaponAttackAction) ea;
                Entity ae = game.getEntity(waa.getEntityId());
                Mounted m = ae.getEquipment(waa.getWeaponId());
                Weapon w = (Weapon) m.getType();
View Full Code Here

Examples of megamek.common.actions.EntityAction

    private void removeDuplicateAttacks(int entityId) {
        boolean attacked = false;
        Vector<EntityAction> toKeep = new Vector<EntityAction>(/* game.actionsSize() */);

        for (Enumeration<EntityAction> i = game.getActions(); i.hasMoreElements();) {
            EntityAction action = i.nextElement();
            if (action.getEntityId() != entityId) {
                toKeep.addElement(action);
            } else if (!attacked) {
                toKeep.addElement(action);
                if (!(action instanceof SearchlightAttackAction)) {
                    attacked = true;
                }
            } else {
                System.err.println("server: removing duplicate phys attack for id#" + entityId);
                System.err.println("        action was " + action.toString());
            }
        }

        // reset actions and re-add valid elements
        game.resetActions();
View Full Code Here

Examples of megamek.common.actions.EntityAction

     */
    private void removeDeadAttacks() {
        Vector<EntityAction> toKeep = new Vector<EntityAction>(game.actionsSize());

        for (Enumeration<EntityAction> i = game.getActions(); i.hasMoreElements();) {
            EntityAction action = i.nextElement();
            Entity entity = game.getEntity(action.getEntityId());
            if ((entity != null) && !entity.isDestroyed() && (entity.isActive() || (action instanceof DfaAttackAction))) {
                toKeep.addElement(action);
            }
        }

View Full Code Here

Examples of org.dmlite.model.action.EntityAction

   * @throws dmLite
   *             action exception if there is a problem
   */
  public boolean update(T entity) throws ActionException {
    boolean updated = false;
    EntityAction entityAction = new EntityAction("update");
    entityAction.setEntity(this);
    entityAction.setParameter(entity);
    try {
      if (this == entity) {
        String error = "Two update entities cannot be the same object.";
        throw new ActionException(error, entityAction);
      }
View Full Code Here

Examples of org.hibernate.action.EntityAction

    int queueSize = ois.readInt();
        LOG.trace("Starting deserialization of [" + queueSize + "] insertions entries");
    rtn.insertions = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      EntityAction action = ( EntityAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.insertions.add( action );
    }

    queueSize = ois.readInt();
        LOG.trace("Starting deserialization of [" + queueSize + "] deletions entries");
    rtn.deletions = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      EntityAction action = ( EntityAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.deletions.add( action );
    }

    queueSize = ois.readInt();
        LOG.trace("Starting deserialization of [" + queueSize + "] updates entries");
    rtn.updates = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      EntityAction action = ( EntityAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.updates.add( action );
    }

    queueSize = ois.readInt();
        LOG.trace("Starting deserialization of [" + queueSize + "] collectionUpdates entries");
    rtn.collectionUpdates = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      CollectionAction action = ( CollectionAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.collectionUpdates.add( action );
    }

    queueSize = ois.readInt();
        LOG.trace("Starting deserialization of [" + queueSize + "] collectionRemovals entries");
    rtn.collectionRemovals = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      CollectionAction action = ( CollectionAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.collectionRemovals.add( action );
    }

    queueSize = ois.readInt();
        LOG.trace("Starting deserialization of [" + queueSize + "] collectionCreations entries");
    rtn.collectionCreations = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      CollectionAction action = ( CollectionAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.collectionCreations.add( action );
    }
    return rtn;
  }
View Full Code Here

Examples of org.hibernate.action.internal.EntityAction

    int queueSize = ois.readInt();
    LOG.tracev( "Starting deserialization of [{0}] insertions entries", queueSize );
    rtn.insertions = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      EntityAction action = ( EntityAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.insertions.add( action );
    }

    queueSize = ois.readInt();
    LOG.tracev( "Starting deserialization of [{0}] deletions entries", queueSize );
    rtn.deletions = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      EntityAction action = ( EntityAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.deletions.add( action );
    }

    queueSize = ois.readInt();
    LOG.tracev( "Starting deserialization of [{0}] updates entries", queueSize );
    rtn.updates = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      EntityAction action = ( EntityAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.updates.add( action );
    }

    queueSize = ois.readInt();
    LOG.tracev( "Starting deserialization of [{0}] collectionUpdates entries", queueSize );
    rtn.collectionUpdates = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      CollectionAction action = (CollectionAction) ois.readObject();
      action.afterDeserialize( session );
      rtn.collectionUpdates.add( action );
    }

    queueSize = ois.readInt();
    LOG.tracev( "Starting deserialization of [{0}] collectionRemovals entries", queueSize );
    rtn.collectionRemovals = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      CollectionAction action = ( CollectionAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.collectionRemovals.add( action );
    }

    queueSize = ois.readInt();
    LOG.tracev( "Starting deserialization of [{0}] collectionCreations entries", queueSize );
    rtn.collectionCreations = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      CollectionAction action = ( CollectionAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.collectionCreations.add( action );
    }
    return rtn;
  }
View Full Code Here

Examples of org.hibernate.action.internal.EntityAction

    int queueSize = ois.readInt();
    LOG.tracev( "Starting deserialization of [{0}] insertions entries", queueSize );
    rtn.insertions = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      EntityAction action = ( EntityAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.insertions.add( action );
    }

    queueSize = ois.readInt();
    LOG.tracev( "Starting deserialization of [{0}] deletions entries", queueSize );
    rtn.deletions = new ArrayList<EntityDeleteAction>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      EntityDeleteAction action = ( EntityDeleteAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.deletions.add( action );
    }

    queueSize = ois.readInt();
    LOG.tracev( "Starting deserialization of [{0}] orphanRemoval entries", queueSize );
    rtn.orphanRemovals = new ArrayList<OrphanRemovalAction>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      OrphanRemovalAction action = ( OrphanRemovalAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.orphanRemovals.add( action );
    }

    queueSize = ois.readInt();
    LOG.tracev( "Starting deserialization of [{0}] updates entries", queueSize );
    rtn.updates = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      EntityAction action = ( EntityAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.updates.add( action );
    }

    queueSize = ois.readInt();
    LOG.tracev( "Starting deserialization of [{0}] collectionUpdates entries", queueSize );
    rtn.collectionUpdates = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      CollectionAction action = (CollectionAction) ois.readObject();
      action.afterDeserialize( session );
      rtn.collectionUpdates.add( action );
    }

    queueSize = ois.readInt();
    LOG.tracev( "Starting deserialization of [{0}] collectionRemovals entries", queueSize );
    rtn.collectionRemovals = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      CollectionAction action = ( CollectionAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.collectionRemovals.add( action );
    }

    queueSize = ois.readInt();
    LOG.tracev( "Starting deserialization of [{0}] collectionCreations entries", queueSize );
    rtn.collectionCreations = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      CollectionAction action = ( CollectionAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.collectionCreations.add( action );
    }

    queueSize = ois.readInt();
    LOG.tracev( "Starting deserialization of [{0}] collectionQueuedOps entries", queueSize );
    rtn.collectionQueuedOps = new ArrayList<Executable>( queueSize );
    for ( int i = 0; i < queueSize; i++ ) {
      CollectionAction action = ( CollectionAction ) ois.readObject();
      action.afterDeserialize( session );
      rtn.collectionQueuedOps.add( action );
    }
    return rtn;
  }
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.