Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jimmycushnie/intersucc
Use SUCC without using magic strings
https://github.com/jimmycushnie/intersucc
configuration configuration-files serialization succ unity
Last synced: 2 months ago
JSON representation
Use SUCC without using magic strings
- Host: GitHub
- URL: https://github.com/jimmycushnie/intersucc
- Owner: JimmyCushnie
- License: wtfpl
- Created: 2019-12-22T20:53:09.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-08T05:24:37.000Z (over 2 years ago)
- Last Synced: 2024-10-11T10:15:30.072Z (3 months ago)
- Topics: configuration, configuration-files, serialization, succ, unity
- Language: C#
- Homepage:
- Size: 33.2 KB
- Stars: 12
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# InterSUCC
This library is an extension for [SUCC](https://github.com/JimmyCushnie/SUCC) which adds generic `DataFile` types. These new types let you save and load data without using any magic strings.**Before:**
```csharp
DataFile File = new DataFile("game.succ");void SaveHighscore(int score)
=> File.Set("highscore", score);int LoadHighscore()
=> File.Get("highscore");
```**After:**
```csharp
public interface IFileData
{
int Highscore { get; set; }
}DataFile File = new DataFile("game.succ");
void SaveHighscore(int score)
=> File.Data.Highscore = score;int LoadHighscore()
=> File.Data.Highscore;
```## Installing
InterSUCC requires [SUCC](https://github.com/JimmyCushnie/SUCC) and [ClassImpl](https://github.com/pipe01/classimpl).
InterSUCC can be installed via the Unity Package Manager. To do so, add the following to the `dependencies` array in your `manifest.json`:
```json
"com.jimmycushnie.intersucc": "https://github.com/JimmyCushnie/InterSUCC.git#unity"
```## Limitations
Due to the nature of InterSUCC's implementation, there's no way to set a default value as you're loading a value. Therefore, it is recommended that you set default values for your files using the [Default Files](https://github.com/JimmyCushnie/SUCC/wiki/Additional-DataFile-Functionality#default-files) feature.
## ConfigWithOverride
Todo document this feature