samedi 3 octobre 2015

I don't know what's wrong

if(handler.obj.isEmpty())
        handler.addObject(new Box(x, y, ID.Box));
    else{
        for(int i = 0; i < handler.obj.size(); i++){
            Object tempObj = handler.obj.get(i);
        if (tempObj.getX() == x && tempObj.getY() == y && tempObj.getId() == ID.Box)
                handler.removeObect(tempObj);
            else
                handler.addObject(new Box(x, y, ID.Box));
        }
    }

I don't know why but the handler.addObject() in the else statement seems unreachable or doesn't work

Aucun commentaire:

Enregistrer un commentaire