Entity entity = (Entity)c.getObject(0);
final Entity entity = (Entity)c.getObject(0);   if ( entity instanceof Protomech ) {   int numPlayerProtos = game.getSelectedEntityCount ( new EntitySelector() { private final int ownerId = entity.getOwnerId(); public boolean accept( Entity entity ) { if ( entity instanceof Protomech && ownerId == entity.getOwnerId() ) return true; return false; } } );     entity.setUnitNumber( (char) (numPlayerProtos / 5) );  }
    private void receiveEntityAdd(Packet c, int connIndex) {        Entity entity = (Entity)c.getObject(0);        // Only assign an entity ID when the client hasn't.        if ( Entity.NONE == entity.getId() ) {            entity.setId(getFreeEntityId());        }        game.addEntity(entity.getId(), entity);        send(createAddEntityPacket(entity.getId()));    }