PageRenderTime 53ms CodeModel.GetById 35ms RepoModel.GetById 1ms app.codeStats 0ms

/src/pointJack/pointjack/gui/listeners/NewGameListener.java

https://bitbucket.org/codenaught/pointjack
Java | 38 lines | 25 code | 8 blank | 5 comment | 0 complexity | 9566e9bf36c533b5f7ae154ff90f4b1f MD5 | raw file
  1. package pointJack.pointjack.gui.listeners;
  2. import pointJack.pointjack.client.PointClient;
  3. import pointJack.pointjack.gui.PointGUI;
  4. import pointJack.game.Logic;
  5. import java.awt.event.ActionEvent;
  6. import java.awt.event.ActionListener;
  7. import javax.swing.JFrame;
  8. /**
  9. *
  10. * @author jthor
  11. * @license http://jthor.no-ip.org/projects/pointjack/license BSD
  12. */
  13. public class NewGameListener implements ActionListener
  14. {
  15. private PointGUI gui;
  16. public NewGameListener(JFrame gui)
  17. {
  18. this.gui = (PointGUI) gui;
  19. }
  20. @Override
  21. public void actionPerformed(ActionEvent e)
  22. {
  23. Logic l = gui.getClient().getLogic();
  24. l.restart();
  25. PointClient pc = (PointClient) gui.getClient();
  26. pc.newGame();
  27. pc.restore();
  28. gui.setNewGame(false);
  29. }
  30. }