Example #1
0
        public static Map Load()
        {
            var map = new Map();
            for (int y = 0; y < HEIGHT; y++) {
                for (int x = 0; x < WIDTH; x++) {
                    if (random.NextDouble() <= FOREST_CHANCE) {
                        map.Cells[y, x] = new Cell(y, x, CellType.Forest);
                    } else {
                        map.Cells[y, x] = new Cell(y, x, CellType.Ground);
                    }
                }
            }
            for (int i = 0; i < random.Next(1, 4); i++) {
                map.Cells = map.DoSimulationStep();
            }

            return map;
        }