Exemplo n.º 1
0
        public MainGrid(Graphics g/*int width, int heigth*/)
        {
            Console.WriteLine("Initializin Grid");

            graphics = g;

            gridCellSide = 30;
            gridCellX = 0;
            gridCellY = 0;

            //gridWidth = 311; //width;
            //gridHeigth = 3; //heigth;

            xCells = 10;
            yCells = 10;

            grid = new GridCell[xCells,yCells];

            for (int i = 0; i < xCells; i++)
            {
                for (int j = 0; j < yCells; j++)
                {
                    grid[i, j] = new GridCell(gridCellSide, gridCellX + 2, gridCellY + 2);
                    if ((i >= 4 && j >= 4) && (i <= 5 && j <= 5))
                    {
                        grid[i, j] = new WallCell(gridCellSide, gridCellX + 2, gridCellY + 2);
                    }

                    gridCellY += gridCellSide +1;
                }
                gridCellX += gridCellSide +1;
                gridCellY = 0;

            }

            Console.WriteLine(grid.GetLowerBound(0));
        }
Exemplo n.º 2
0
        public MainGrid(Graphics g /*int width, int heigth*/)
        {
            Console.WriteLine("Initializin Grid");

            graphics = g;

            gridCellSide = 30;
            gridCellX    = 0;
            gridCellY    = 0;

            //gridWidth = 311; //width;
            //gridHeigth = 3; //heigth;

            xCells = 10;
            yCells = 10;

            grid = new GridCell[xCells, yCells];

            for (int i = 0; i < xCells; i++)
            {
                for (int j = 0; j < yCells; j++)
                {
                    grid[i, j] = new GridCell(gridCellSide, gridCellX + 2, gridCellY + 2);
                    if ((i >= 4 && j >= 4) && (i <= 5 && j <= 5))
                    {
                        grid[i, j] = new WallCell(gridCellSide, gridCellX + 2, gridCellY + 2);
                    }

                    gridCellY += gridCellSide + 1;
                }
                gridCellX += gridCellSide + 1;
                gridCellY  = 0;
            }

            Console.WriteLine(grid.GetLowerBound(0));
        }