package beans;

import ui.*;
import java.awt.event.*;

/**
 * @author Bruno Vedovetto @bleandro
 * @author Lucas Pinheiro @lucaspin
 * @author Dalton Lima @daltonbr
 */
public class GameController {

    /**
     * Constructor of the class
     */
    public GameController() {
        MainView mainView = new MainView();
        mainView.setVisible(true);
        this.setWindowClosingHandler(mainView);
    }

    /**
     * Sets the handler for when the window closes
     * @param mainView {MainView} the main frame of the application
     */
    private void setWindowClosingHandler(MainView mainView) {
        mainView.addWindowListener(new WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                super.windowClosing(e);
                e.getWindow().dispose();
            }
        });
    }
}

@@ -21,16 +21,39 @@
 rt ui.*;
+%0A%0Aimport javax.swing.*;
 %0Aimport 
@@ -69,16 +69,39 @@
 event.*;
+%0Aimport java.util.List;
 %0A%0A/**%0A *
@@ -242,293 +242,309 @@
 r %7B%0A
-%0A    /**%0A     * Constructor of the class%0A     */%0A    public GameController() %7B%0A        MainView mainView = new MainView();%0A        mainView.setVisible(true);%0A        this.setWindowClosingHandler(mainView);%0A    %7D%0A
+    private boolean ended = false;%0A    private List%3CPlayer%3E players;%0A    private Deck deck;%0A%0A    /**%0A     * Constructor of the class%0A     */%0A    public GameController() %7B%0A        SwingUtilities.invokeLater(new Runnable() %7B%0A            @Override%0A            public void run() %7B
 %0A    
-/**%0A
      
-* Sets the handler for when the window closes%0A     * @param
+       MainView
  mai
@@ -553,17 +553,22 @@
 iew 
-%7B
+= new 
 MainView
 %7D th
@@ -567,114 +567,63 @@
 View
-%7D the main frame of the application%0A
+();%0A       
      
-*/%0A
     
-private void setWindowClosingHandler(MainView mainView) %7B%0A
+mainView.setVisible(true);%0A        
     
@@ -679,32 +679,40 @@
 ) %7B%0A            
+  
+      
 @Override%0A      
@@ -697,32 +697,40 @@
       @Override%0A
+        
             publ
@@ -784,16 +784,24 @@
         
+  
+      
 super.wi
@@ -812,24 +812,32 @@
 Closing(e);%0A
+        
             
@@ -881,20 +881,606 @@
     
+  
-%7D%0A        %7D)
+      %7D%0A                %7D);%0A            %7D%0A        %7D);%0A%0A        this.initGame();%0A    %7D%0A%0A    /**%0A     * Initializes the game%0A     */%0A    private void initGame() %7B%0A        // TODO: create players%0A        // TODO: create deck%0A        // TODO: create the points%0A        // TODO: start game loop%0A    %7D%0A%0A    /**%0A     * Set the new status of the game%0A     * @param ended %7BBoolean%7D%0A     */%0A    public void setEnded(boolean ended) %7B%0A        this.ended = ended;%0A    %7D%0A%0A    /**%0A     * Check if the game has ended%0A     * @return ended %7BBoolean%7D%0A     */%0A    public boolean isEnded() %7B%0A        return this.ended
 ;%0A  

Add GameController initial properties