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); }
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()); }
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(); }
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; }