private void receiveAttack(Packet pkt) { Vector vector = (Vector)pkt.getObject(1); Entity entity = game.getEntity(pkt.getIntValue(0)); for (Enumeration i = vector.elements(); i.hasMoreElements();) { EntityAction ea = (EntityAction)i.nextElement();   if (ea instanceof PushAttackAction) { PushAttackAction paa = (PushAttackAction)ea; entity.setDisplacementAttack(paa); pendingCharges.addElement(paa); } else {  attacks.addElement(ea); }   if (ea instanceof TorsoTwistAction) { TorsoTwistAction tta = (TorsoTwistAction)ea; game.getEntity(tta.getEntityId()).setSecondaryFacing(tta.getFacing()); } else if (ea instanceof FlipArmsAction) { FlipArmsAction faa = (FlipArmsAction)ea; game.getEntity(faa.getEntityId()).setArmsFlipped(faa.getIsFlipped()); }    send(createAttackPacket(ea));
private void receiveAttack(Packet packet, int connId) { Entity entity = game.getEntity(packet.getIntValue(0)); Vector vector = (Vector)packet.getObject(1);   if (game.getPhase() != Game.PHASE_FIRING && game.getPhase() != Game.PHASE_PHYSICAL) { System.err.println("error: server got attack packet in wrong phase");
    private void receiveAttack(Packet pkt) {        Vector vector = (Vector)pkt.getObject(1);        Entity entity = game.getEntity(pkt.getIntValue(0));        for (Enumeration i = vector.elements(); i.hasMoreElements();) {            EntityAction ea = (EntityAction)i.nextElement();                        // move push attacks the end of the displacement attacks            if (ea instanceof PushAttackAction) {                PushAttackAction paa = (PushAttackAction)ea;                entity.setDisplacementAttack(paa);                pendingCharges.addElement(paa);            } else {                // add to the normal attack list.                attacks.addElement(ea);            }                        // if torso twist, twist so that everybody can see it later            if (ea instanceof TorsoTwistAction) {                TorsoTwistAction tta = (TorsoTwistAction)ea;                game.getEntity(tta.getEntityId()).setSecondaryFacing(tta.getFacing());            } else if (ea instanceof FlipArmsAction) {                FlipArmsAction faa = (FlipArmsAction)ea;                game.getEntity(faa.getEntityId()).setArmsFlipped(faa.getIsFlipped());            }                                    // send an outgoing packet to everybody            send(createAttackPacket(ea));        }        // this entity is done for the round        entity.setDone(true);        entityUpdate(entity.getId());    }