Exemplo n.º 1
0
    void Doorate()
    {
        int p = 0;

        for (int x = 0; x < size; x++)
        {
            for (int y = 0; y < size; y++)
            {
                if (grid[x, y] == 2)
                {
                    bool[] door = new bool[5];
                    if (grid[x + 1, y] == 1)
                    {
                        door[1] = true;
                    }
                    if (grid[x, y - 1] == 1)
                    {
                        door[2] = true;
                    }
                    if (grid[x - 1, y] == 1)
                    {
                        door[3] = true;
                    }
                    if (grid[x, y + 1] == 1)
                    {
                        door[4] = true;
                    }

                    rContr.Doors(p, door);
                    p++;
                }
            }
        }
    }