int condition = Game.UNIT_SALVAGEABLE; if ( !entity.isSalvage() ) { condition = Game.UNIT_DEVASTATED; } game.removeEntity(entity.getId(), condition); send( createRemoveEntityPacket(entity.getId(), condition) );
toRemove.add(entity);
    private void resetEntityPhase() {        // first, mark doomed entities as destroyed and move them to the graveyard        for (Enumeration e = game.getEntities(); e.hasMoreElements();) {            final Entity entity = (Entity)e.nextElement();                        if (entity.crew.isDoomed()) {                entity.crew.setDead(true);                entity.setDestroyed(true);            }                        if (entity.isDoomed()) {                entity.setDestroyed(true);            }            if (entity.isDestroyed() || entity.getCrew().isDead()) {                int condition = Game.UNIT_SALVAGEABLE;                if ( !entity.isSalvage() ) {                    condition = Game.UNIT_DEVASTATED;                }                game.removeEntity(entity.getId(), condition);                send( createRemoveEntityPacket(entity.getId(), condition) );            }        }                for (Enumeration e = game.getEntities(); e.hasMoreElements();) {            final Entity entity = (Entity)e.nextElement();                        entity.applyDamage();                        entity.reloadEmptyWeapons();                        // reset damage this phase            entity.damageThisPhase = 0;                        // reset done to false            entity.setDone(!entity.isActive());        }    }