示例#1
0
        public MainWindow()
        {
            InitializeComponent();
            Game = new Game();

            #region UI
            Game.GuiInteraction          = new Gui_Interaction(this, Game);
            this.label_TIME.Content      = "PLAYTIME : " + System.Environment.NewLine + "00:00:00";
            this.label_Controls1.Content = "SYSTEM-CONTROLS : " + System.Environment.NewLine + " • ENTER = Start" + System.Environment.NewLine + " • SPACE = Pause" + System.Environment.NewLine +
                                           " • ESCAPE  = Quit ";

            this.label_Controls.Content = "MOVEMENT-CONTROLS : " + System.Environment.NewLine + " • LEFT = Move left" + System.Environment.NewLine +
                                          " • RIGHT = Move right" + System.Environment.NewLine + " • DOWN = Move down" + System.Environment.NewLine + " • UP = Rotate";
            //  Intro();


            this.KeyDown += new KeyEventHandler(Window_KeyDown);
            // Erstelle GameBoard
            Board_UI_GameBoard = new BoardUI(this, Game, Grid_GameBoard);
            Board_UI_GameBoard.ErstelleGrid(this.Game.Config.Width_GameBoard, this.Game.Config.Height_GameBoard);
            Board_UI_GameBoard.GenerateBoardFeldArray(this.Game.Config.Width_GameBoard, this.Game.Config.Height_GameBoard);

            // Erstelle PreviewBoard
            Board_UI_PreviewBoard = new BoardUI(this, Game, Grid_PreviewBoard);
            Board_UI_PreviewBoard.ErstelleGrid(this.Game.Config.Width_Preview, this.Game.Config.Height_Preview);
            Board_UI_PreviewBoard.GenerateBoardFeldArray(this.Game.Config.Width_Preview, this.Game.Config.Height_Preview);

            Sync       = new SyncMaster(Game, Board_UI_GameBoard, Board_UI_PreviewBoard, this);
            this.Timer = new Timer_GUI(this.Dispatcher, this, Sync, Game);

            //this.Width = 1468;
            //this.Height = 826;
            // 0,5626702997275204

            this.Width  = 1680;
            this.Height = 1680 * ((double)826 / 1468);

            //this.Height = 1050;
            // 0,625
            //    this.Show();
            //System.Windows.Forms.Screen screen = System.Windows.Forms.Screen.PrimaryScreen;
            //screen.Bounds
            #endregion UI
        }