Ejemplo n.º 1
0
    private int CountCompletedRow(bool[,,] checkedPool)
    {
        int completedRowNum = 0;

        Array3D <bool> pool = new Array3D <bool>(checkedPool);

        for (int z = 0; z < this.GetSizeZ(); z++)
        {
            for (int y = 0; y < this.GetSizeY(); y++)
            {
                if (pool.TakeXRow(y, z).All(e => e == true))
                {
                    completedRowNum++;
                }
            }
        }

        for (int x = 0; x < this.GetSizeX(); x++)
        {
            for (int y = 0; y < this.GetSizeY(); y++)
            {
                if (pool.TakeZRow(x, y).All(e => e == true))
                {
                    completedRowNum++;
                }
            }
        }

        return(completedRowNum);
    }
Ejemplo n.º 2
0
    private bool[,,] SearchCubeThatMustBeRemoved()
    {
        bool[,,] mustBeRemovedCubes = new bool[this.GetSizeX(), this.GetSizeY(), this.GetSizeZ()];

        Array3D <GameObject> pool        = new Array3D <GameObject>(blockPool);
        Array3D <bool>       checkedPool = new Array3D <bool>(mustBeRemovedCubes);

        for (int z = 0; z < this.GetSizeZ(); z++)
        {
            for (int y = 0; y < this.GetSizeY(); y++)
            {
                if (pool.TakeXRow(y, z).All(e => e != null))
                {
                    checkedPool.SetXRow(y, z, true);
                }
            }
        }

        for (int x = 0; x < this.GetSizeX(); x++)
        {
            for (int y = 0; y < this.GetSizeY(); y++)
            {
                if (pool.TakeZRow(x, y).All(e => e != null))
                {
                    checkedPool.SetZRow(x, y, true);
                }
            }
        }

        return(checkedPool.GetArray3D());
    }
Ejemplo n.º 3
0
    private bool[,,] SearchCubeThatMustBeRemoved()
    {
        bool[,,] mustBeRemovedCubes = new bool[this.GetSizeX(), this.GetSizeY(), this.GetSizeZ()];

        Array3D<GameObject> pool = new Array3D<GameObject>(blockPool);
        Array3D<bool> checkedPool = new Array3D<bool>(mustBeRemovedCubes);

        for (int z = 0; z < this.GetSizeZ(); z++)
            for (int y = 0; y < this.GetSizeY(); y++)
                if (pool.TakeXRow(y, z).All(e => e != null))
                    checkedPool.SetXRow(y, z, true);

        for (int x = 0; x < this.GetSizeX(); x++)
            for (int y = 0; y < this.GetSizeY(); y++)
                if (pool.TakeZRow(x, y).All(e => e != null))
                    checkedPool.SetZRow(x, y, true);

        return checkedPool.GetArray3D();
    }
Ejemplo n.º 4
0
    private int CountCompletedRow(bool[,,] checkedPool)
    {
        int completedRowNum = 0;

        Array3D<bool> pool = new Array3D<bool>(checkedPool);

        for (int z = 0; z < this.GetSizeZ(); z++)
            for (int y = 0; y < this.GetSizeY(); y++)
                if (pool.TakeXRow(y, z).All(e => e == true))
                    completedRowNum++;

        for (int x = 0; x < this.GetSizeX(); x++)
            for (int y = 0; y < this.GetSizeY(); y++)
                if (pool.TakeZRow(x, y).All(e => e == true))
                    completedRowNum++;

        return completedRowNum;
    }