public static EmptyGrid ProcessMap(EmptyGrid map, RandomWalkSettings settings) { // Random Generator Random.State initialState = Random.state; if (settings.useFixedSeed) { Random.InitState(settings.seed.GetHashCode()); } else { Random.InitState(Time.time.ToString().GetHashCode()); } map.values = RandomWalk.TransformBoolToCell(RandomWalk.GetCarvedMap(map.width, map.height, settings), CellType.Floor, CellType.Wall); Random.state = initialState; return(map); }
/// TODO: Add null ref checking /// public static bool[,] GetCarvedMap(int mapWidth, int mapHeight, RandomWalkSettings walkSettings) { width = mapWidth; height = mapHeight; // Create boolean Map map = new bool[width, height]; settings = walkSettings; //Initial filling for (int z = 0; z < height; z++) { for (int x = 0; x < width; x++) { map[x, z] = false; } } CarveMap(); return(map); }