}
private void setMoves() {
pokemon.removeAllMoves();
MoveInfo mi;
AvailableMoveSelector ams;
for (Component c : movePanel.getComponents()) {
if (!(c instanceof AvailableMoveSelector)) {
continue;
}
ams = (AvailableMoveSelector) c;
mi = ams.getCurrentElement();
if (mi == null) {
continue;
}
try {
pokemon.addMove(mi.getNumber());
} catch (IllegalArgumentException e) {
ams.setSelectedItem(null);
}
}
}