// Render player letters
// For each rack letter
for (int i = 0; i < MAX_RACK_LETTERS; i++) {
Letter letter = rack.getLetter(ordre[i]);
int x = 16 + ox + i * 64;
int y = 16 + oy;
// Draw empty case
g.setColor(Color.BLACK);
g.drawRect(x, y, CASE_SIZE, CASE_SIZE);
// Draw occupied case
if (letter != null) {
letter.render(g, x, y);
// Color selected letter
if (i == selected) {
g.setColor(SELECTED_CASE_COLOR);
g.fillRect(x, y, CASE_SIZE, CASE_SIZE);
}
// Color hovered Letter
if (i == hovered) {
g.setColor(SELECTED_RACK_LETTER_COLOR);
g.fillRect(x, y, CASE_SIZE, CASE_SIZE);
}
}
}
// Color letter that are marked to be reset
for (Integer index : toReset) {
Letter letterToReset = rack.getLetter(ordre[index]);
if (letterToReset != null) {
int x = 16 + ox + index * 64;
int y = 16 + oy;
g.setColor(SELECTED_RACK_LETTER_RESET_COLOR);