Exemple #1
0
    public void generatePlayground(int width, int height)
    {
        var playground = new GameObject();

        playground.name = "playground";

        for (int x = -width; x <= width; x++)
        {
            for (int y = -height; y <= height; y++)
            {
                var grid = new PlaygroundGrid(x, y);
                grids.Add(grid);
            }
        }
    }
Exemple #2
0
        /// <summary>
        /// Method return number of 'live' points.
        /// </summary>
        /// <returns> int - Number of live points. </returns>
        public int GetNumberOfLivePoints()
        {
            int sum = PlaygroundGrid.Cast <int>().Sum();

            return(sum);
        }