Skip to content
Snippets Groups Projects
Game.java 892 B
Newer Older
  • Learn to ignore specific revisions
  • Kovax's avatar
    v2
    Kovax committed
    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
    
    package GUI.game;
    
    
    import Program.Program;
    import Program.Settings;
    
    
    
    
    Kovax's avatar
    v2
    Kovax committed
    /**
     *
     * @author Kovax
     */
    
    public class Game  
    
    Kovax's avatar
    Kovax committed
    {
        public Controller controller;
    
        public Settings settings;
    
    Kovax's avatar
    Kovax committed
        
    
        public Game(Settings settings)
    
    Kovax's avatar
    Kovax committed
        {
    
            this.settings = settings;
            this.startGUI();
        }
     
        public synchronized void startGUI()
        {
            Controller game    = new Controller(this.settings);
            
            Model gameModel    = new Model(game);
            View gameView      = new View(game,gameModel);
            game.registerModel(gameModel);
            game.registerView(gameView);
    
    Dániel's avatar
    Dániel committed
            game.gameStart();
    
    Kovax's avatar
    Kovax committed
            
            this.controller = game;
        }
    
    Kovax's avatar
    v2
    Kovax committed
    }