Пример #1
0
        public static Form GenerateGun(GunFormTypes gunFormType)
        {
            switch (gunFormType)
            {
            case GunFormTypes.GosperGliderGun:
                return(GenerateGosperGliderGun());

            case GunFormTypes.Period22GliderGun:
                return(GeneratePeriod22GliderGun());

            case GunFormTypes.BiGun:
                return(GenerateBiGun());

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Пример #2
0
        /// <summary>
        /// Method to generate a table with a gun form of conway's game of life.
        /// </summary>
        /// <param name="gunFormType"> One of the <see cref="GunFormTypes"/> to generate on a table. </param>
        /// <returns> A generated 2D int array with the given gun form. </returns>
        public int[,] GenrateTableWithForm(GunFormTypes gunFormType)
        {
            Form form = FormFactory.GenerateGun(gunFormType);

            return(SpawnForm.GenerateFormOnTable(form));
        }