Esempio n. 1
0
        public static Form GenerateSpaceshipForm(SpaceshipFormTypes spaceshipFormType)
        {
            switch (spaceshipFormType)
            {
            case SpaceshipFormTypes.Glider:
                return(GenerateGlider());

            case SpaceshipFormTypes.LightWeightSpaceship:
                return(GenerateLightWeightSpacheship());

            case SpaceshipFormTypes.HeavyWeightSpaceship:
                return(HeavyWeightSpaceship());

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

            return(SpawnForm.GenerateFormOnTable(form));
        }