{"id":22208257,"url":"https://github.com/popcron/configs","last_synced_at":"2025-03-25T04:35:13.135Z","repository":{"id":139287023,"uuid":"157123494","full_name":"popcron/configs","owner":"popcron","description":"A simple config file API, primarily for games.","archived":false,"fork":false,"pushed_at":"2018-11-12T13:16:51.000Z","size":21,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-30T04:42:35.185Z","etag":null,"topics":["csharp"],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/popcron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-11T21:36:25.000Z","updated_at":"2021-04-27T10:18:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"2906d3a1-1c9c-4f22-a702-5e79c36ecb92","html_url":"https://github.com/popcron/configs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/popcron%2Fconfigs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/popcron%2Fconfigs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/popcron%2Fconfigs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/popcron%2Fconfigs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/popcron","download_url":"https://codeload.github.com/popcron/configs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245401371,"owners_count":20609163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp"],"created_at":"2024-12-02T19:17:00.273Z","updated_at":"2025-03-25T04:35:13.092Z","avatar_url":"https://github.com/popcron.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Configs\nA simple config file API with type serialization, primarily used for games. In the case of use in Unity, the Type and Value fields are serialized and hot-reload friendly.\n\n## Requirements\n- .NET Framework 2.0\n\n## Example\n```cs\nConfig config = Config.Load(\"settings\");\nstring name = config[\"name\"].Value;\nDateTime time = DateTime.Now;\n\n//if a time variable exists, then get its value\n//otherwise, add the current time as a new variable\nif (config.Contains(\"time\"))\n{\n    time = (DateTime)config[\"time\"].Value;\n}\nelse\n{\n    config.Add(\"time\", time);\n    \n    //save as well\n    config.Save();\n}\n```\n\n## Loading\n```cs\nConfig audioSettings = Config.Load(\"audioSettings\");\nfloat volume = (float)audioSettings[\"volume\"];\nfloat pan = (float)audioSettings[\"pan\"];\nfloat pitch = (float)audioSettings[\"pitch\"];\n```\n\n## Saving\n```\nConfig audioSettings = Config.Load(\"audioSettings\");\naudioSettings[\"volume\"] = 0f;\naudioSettings.Save();\n```\n\n## Format\nThe format in use follows the `name:type=value` pattern. If a type isnt given, it will assume a string.\n\n## Settings\nThe settings class provides the ability to customize some of the behaviour of the configs. The `Config` class has a static property that uses the Settings, if none is provided, it will use a default one instead.\n\n**Extension**: The extension to use when saving and loading config files, default is `cfg`.\n\n**ThrowsExceptions**: If this is set to true, it will throw exception on errors.\n\n**Directory**: This is the default directory to use when saving and loading, if set to null, it will use the base directory of the executable.\n\n**TypeDelimeter**: The character used for splitting the name from the type field, default is `:`.\n\n**ValueDelimeter**: The character used for splitting the type from the value, default is `=`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpopcron%2Fconfigs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpopcron%2Fconfigs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpopcron%2Fconfigs/lists"}