Skip to content

JimmyCushnie/InterSUCC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

InterSUCC

This library is an extension for SUCC which adds generic DataFile types. These new types let you save and load data without using any magic strings.

Before:

DataFile File = new DataFile("game.succ");

void SaveHighscore(int score)
    => File.Set("highscore", score);

int LoadHighscore()
    => File.Get<int>("highscore");

After:

public interface IFileData
{
    int Highscore { get; set; }
}

DataFile<IFileData> File = new DataFile<IFileData>("game.succ");

void SaveHighscore(int score)
    => File.Data.Highscore = score;

int LoadHighscore()
    => File.Data.Highscore;

Installing

InterSUCC requires SUCC and ClassImpl.

InterSUCC can be installed via the Unity Package Manager. To do so, add the following to the dependencies array in your manifest.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 feature.

ConfigWithOverride

Todo document this feature

About

Use SUCC without using magic strings

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages