Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>a list of every full cell in the containment building</returns>
        public List <Cell> FindFilledCells()
        {
            List <Cell> output      = new List <Cell>();
            Containment containment = buildings["containment"].GetComponent <Containment>();
            CellBlock   cellBlock   = null;

            foreach (GameObject floor in containment.Floors)
            {
                cellBlock = floor.GetComponent <CellBlock>();
                foreach (Cell cell in cellBlock.Cells)
                {
                    if (cell.IsFilled)
                    {
                        output.Add(cell);
                    }
                }
            }
            return(output);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns>a list of every cell in the containment building</returns>
        public List <Cell> FindCells()
        {
            List <Cell> output      = new List <Cell>();
            Containment containment = buildings["containment"].GetComponent <Containment>();
            CellBlock   cellBlock   = null;

            foreach (GameObject floor in containment.Floors)
            {
                cellBlock = floor.GetComponent <CellBlock>();
                foreach (Cell cell in cellBlock.Cells)
                {
                    //if (cell != null)
                    output.Add(cell);
                }
            }

            Debug.Log(output.Count);
            return(output);
        }