コード例 #1
0
 private void shapesButton_Click(object sender, RoutedEventArgs e)
 {
     if (ssw == null)
     {
         MessageBox.Show("????");
     }
     this.RemoveVisualChild(ssw);
     ssw = null;
     if (Tetromino.POSSIBLE_TETROMINOS.Count == 4)
     {
         this.RemoveVisualChild(ssw);
         ssw = new ShapeSelectorWindow(Tetromino.POSSIBLE_TETROMINOS);
     }
     else
     {
         ssw = new ShapeSelectorWindow();
     }
     this.RemoveVisualChild(ssw);
     ssw.ShowDialog();
     //here be dragons
     if (ssw.ShapesMadeCount == 4)
     {
         Startable = true;
         Tetromino.GenerateShapes(ssw.ExportSelection());
     }
 }
コード例 #2
0
ファイル: GameWindow.xaml.cs プロジェクト: x-j/Soviet-Russia
        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            timer.Stop();
            ShapeSelectorWindow ssw = new ShapeSelectorWindow(Tetromino.POSSIBLE_TETROMINOS);

            ssw.ShowDialog();
            ssw.Close();
            Tetromino.GenerateShapes(ssw.ExportSelection());
            timer.Start();
        }
コード例 #3
0
        public MainMenuWindow()
        {
            InitializeComponent();

            ssw = new ShapeSelectorWindow();

            DataContext = this;

            Startable = false;
        }