Exemplo n.º 1
0
        public WallData CollectVerticalWall(int column, int row)
        {
            WallData result = new WallData(WallOrientation.Vertical);

            result.StartColumn = column;
            result.StartRow    = row - 1;
            int startX = column * Tile.Width;
            int startY = row * Tile.Height;

            while (row < NumRows && HasVerticalWall(column, row + 1) && !HasHorizontalTouchingWall(column, row))
            {
                row++;
            }
            result.EndColumn = column;
            result.EndRow    = row;
            int endY = row * Tile.Height;

            result.X          = startX;
            result.Y          = startY;
            result.WallLength = endY + Tile.Height - startY;
            return(result);
        }
Exemplo n.º 2
0
        public WallData CollectHorizontalWall(int column, int row)
        {
            WallData result = new WallData(WallOrientation.Horizontal);

            result.StartColumn = column - 1;
            result.StartRow    = row;
            int startX = column * Tile.Width;
            int startY = row * Tile.Height;

            while (column < NumColumns && HasHorizontalWall(column + 1, row) && !HasVerticalTouchingWall(column, row))
            {
                column++;
            }
            result.EndColumn = column;
            result.EndRow    = row;
            int endX = column * Tile.Width;

            result.X          = startX;
            result.Y          = startY;
            result.WallLength = endX + Tile.Width - startX;
            return(result);
        }