@Override
        public void actionPerformed(ActionEvent e) {
            if (e == null || e.getSource() == clearButton) {
                currState = game.getInitialState();
                currState.rollDice();
            }
            else if (!game.isTerminal(currState)) {
                if (e.getSource() == proposeButton) { //AI moves piece
                    proposeMove();
                }
                else if (e.getSource() instanceof GridElement) { //try to move a piece
                    GridElement el = (GridElement) e.getSource();
                    currState = game.getResult(currState, el.location, false);
                }
                else if (e.getSource() instanceof DieElement) { //select a different Die
                    DieElement el = (DieElement) e.getSource();
                    
                    if (el.dieNumber != currState.getSelectedDie()) currState.changeSelectedDie();
                }
            }
            repaint();
            updateStatus();
        }