* @param y the y coord
*/
public void hold(GameRoom room, int x, int y) {
Point point = new Point(x, y);
for (int i = 0; i < room.getDice().getDice().size(); i++) {
Die tempDie = room.getDice().getDice().get(i);
if (tempDie.getDieFixture().contains(point)) {
if (!room.getDice().getSavedDice().contains(tempDie)) {
room.getDice().addToSavedDice(tempDie);
tempDie.setDieFixture(new Point(
GameplayFrame.DIE_SAVE_AREA_WIDTH
+ (Die.DIE_DIMENSION + 5) * i,
GameplayFrame.DIE_SAVE_AREA_HEIGHT));
return;
} else if (room.getDice().getSavedDice().contains(tempDie)) {
room.getDice().removeFromSavedDice(tempDie);
tempDie.calculateNewFixtureLocation();
return;
}
}
}
}