コード例 #1
0
 public ColonyDestinationAsteroidData(string worldName, int seed)
 {
     Scale       = 1f;
     TargetScale = 1f;
     world       = SettingsCache.worlds.GetWorldData(worldName);
     ReInitialize(seed);
 }
    public string GetSettingsCoordinate()
    {
        ProcGen.World worldData             = SettingsCache.worlds.GetWorldData(Instance.GetCurrentQualitySetting(CustomGameSettingConfigs.World).id);
        SettingLevel  currentQualitySetting = Instance.GetCurrentQualitySetting(CustomGameSettingConfigs.WorldgenSeed);
        string        otherSettingsCode     = GetOtherSettingsCode();

        return($"{worldData.GetCoordinatePrefix()}-{currentQualitySetting.id}-{otherSettingsCode}");
    }
    private static void AddWorldMods(object user_data, List <SettingLevel> levels)
    {
        string path = FileSystem.Normalize(System.IO.Path.Combine(SettingsCache.GetPath(), "worlds"));

        ListPool <string, CustomGameSettings> .PooledList pooledList = ListPool <string, CustomGameSettings> .Allocate();

        FileSystem.GetFiles(path, "*.yaml", pooledList);
        foreach (string item in pooledList)
        {
            ProcGen.World world       = YamlIO.LoadFile <ProcGen.World>(item, null, null);
            string        worldName   = Worlds.GetWorldName(item);
            string        id          = worldName;
            string        name        = world.name;
            string        description = world.description;
            levels.Add(new SettingLevel(id, name, description, 0, user_data));
        }
        pooledList.Recycle();
    }