Quote:
Originariamente inviato da Baol
Lavorando in CrushByFlashAction.java su getAllGemsSameOf.
Prima:
Codice:
//TODO: REFACTOR THIS
private DroppableList getAllGemsSameOf(Droppable gemToDelete)
{
DroppableList gemList = new DroppableList();
Droppable gem;
for(int row = getGrid().getNumberOfRows() - 1; row >= 0; row--)
{
for(int column = 0; column < getGrid().getNumberOfColumns(); column++)
{
gem = getGrid().getDroppableAt(row, column);
if(gem == null)
{
continue;
}
if(gem.getGridObject().getColor() == gemToDelete.getGridObject().getColor())
{
if(!gemList.contains(gem))
{
gemList.add(gem);
}
}
}
}
return gemList;
}
...
|
Mmm, qua ci vorrebbe un modo facile per ottenere tutte le gemme dello stesso tipo nella griglia ...