示例#1
0
        public static Form GenerateStillLifeForm(StillLifeFormTypes FormType)
        {
            switch (FormType)
            {
            case StillLifeFormTypes.Block:
                return(GenerateBlock());

            case StillLifeFormTypes.Beehive:
                return(GenerateBeehive());

            case StillLifeFormTypes.Table:
                return(GenerateTable());

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
        /// <summary>
        /// Method to generate a table with a stilllife form of conway's game of life.
        /// </summary>
        /// <param name="stillLifeFormType"> One of the <see cref="StillLifeFormTypes"/> to generate on a table. </param>
        /// <returns> A generated 2D int array with the given stilllife form. </returns>
        public int[,] GenrateTableWithForm(StillLifeFormTypes stillLifeFormType)
        {
            Form form = FormFactory.GenerateStillLifeForm(stillLifeFormType);

            return(SpawnForm.GenerateFormOnTable(form));
        }