Exemplo n.º 1
0
        public void setUpBoard()
        {
            
            for (int r = 0; r < boardRow; r++)
            {
                for (int c = 0; c < boardCol; c++)
                {
                    cell[r,c] = new Grid();
                    switch (table[r, c])
                    {
                         case 1:
                                                         
                            
                            terrain[r, c] = new Mage();
                            terrain[r,c].Background = terrain[r, c].Image;
                            
                            
                            terrain[r, c].BorderThickness = new Thickness(0);
                           

                            break;
                        default:
                            terrain[r, c] = new Tile();
                            terrain[r,c].Background = grass;
                            terrain[r, c].BorderThickness = new Thickness(0);
                                                              
                                   break;

                    }
                    terrain[r, c].Row = r;
                    terrain[r, c].Col = c;
                    terrain[r, c].Click += new RoutedEventHandler(moveCharacter);
                   // cell[r, c].Children.Add(terrain[r, c]);
                    Board.Children.Add(terrain[r, c]);
                     
                    
                    
                }

            }
        }
Exemplo n.º 2
0
        public void setUpBoard()
        {
            for (int r = 0; r < boardRow; r++)
            {
                for (int c = 0; c < boardCol; c++)
                {
                    cell[r, c] = new Grid();
                    switch (table[r, c])
                    {
                    case 1:


                        terrain[r, c]            = new Mage();
                        terrain[r, c].Background = terrain[r, c].Image;


                        terrain[r, c].BorderThickness = new Thickness(0);


                        break;

                    default:
                        terrain[r, c]                 = new Tile();
                        terrain[r, c].Background      = grass;
                        terrain[r, c].BorderThickness = new Thickness(0);

                        break;
                    }
                    terrain[r, c].Row    = r;
                    terrain[r, c].Col    = c;
                    terrain[r, c].Click += new RoutedEventHandler(moveCharacter);
                    // cell[r, c].Children.Add(terrain[r, c]);
                    Board.Children.Add(terrain[r, c]);
                }
            }
        }