示例#1
0
        public void CreateUniverse(int width, int height, int pattern)
        {
            UState.Width  = width;
            UState.Height = height;
            UState.grid   = UState.newGrid = new bool[width, height];

            Patterns genezis = new Patterns(pattern, UState.grid);

            GenezisCountOfCells();
        }
        private int[][] getImpactedCells(int x, int y)
        {
            if (LastSelectedMenuItem != null && LastSelectedMenuItem.IsChecked)
            {
                String selectionType = LastSelectedMenuItem.Name as String;

                switch (selectionType)
                {
                case "linePattern":
                    return(Patterns.Line(x, y));

                case "crossPattern":
                    return(Patterns.Cross(x, y));

                case "gliderPattern":
                    return(Patterns.Glider(x, y));

                case "starPattern":
                    return(Patterns.Star(x, y));
                }
            }
            return(Patterns.Cell(x, y));
        }