예제 #1
0
 private void Generate_Maze(object sender, RoutedEventArgs e)
 {
     Maze.Children.Clear();
     Maze.RowDefinitions.Clear();
     Maze.ColumnDefinitions.Clear();
     MazeCell[,] grid = CreateGrid(Convert.ToInt32(MazeInfo.MazeWidth), Convert.ToInt32(MazeInfo.MazeHeight));
     maze             = new MazeContent(grid);
     maze.GenerateMaze(Convert.ToInt32(MazeInfo.MazeWidth), Convert.ToInt32(MazeInfo.MazeHeight));
 }
예제 #2
0
 public MainWindow()
 {
     InitializeComponent();
     MazeInfo            = new MazeInfo();
     MazeInfo.MazeWidth  = "20";
     MazeInfo.MazeHeight = "20";
     this.DataContext    = MazeInfo;
     MazeCell[,] grid    = CreateGrid(Convert.ToInt32(MazeInfo.MazeWidth), Convert.ToInt32(MazeInfo.MazeHeight));
     maze = new MazeContent(grid);
     maze.GenerateMaze(Convert.ToInt32(MazeInfo.MazeWidth), Convert.ToInt32(MazeInfo.MazeHeight));
 }