Advertisement
mikhail_dvorkin

Untitled

Feb 18th, 2017
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. import javax.swing.JFrame;
  2.  
  3. public class GameController {
  4.     GameModel model;
  5.    
  6.     public GameController(GameModel model) {
  7.         this.model = model;
  8.     }
  9.  
  10.     public void receiveAction(int x, int y) {
  11.         model.makeMove(x, y);
  12.     }
  13.    
  14.     public static void main(String[] args) {
  15.         GameModel model = new GameModel();
  16.         GameController controller = new GameController(model);
  17.         GameGUIView view = new GameGUIView(model, controller);
  18.         JFrame frame = new JFrame("Game");
  19.         frame.setSize(300, 300);
  20.         frame.add(view);
  21.         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  22.         frame.setVisible(true);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement