#gamedev #data-management #save-system #save-management

savesys

Variable-based save management system

12 stable releases

3.5.11 Aug 3, 2022
3.5.10 Jul 30, 2022
3.5.9 Apr 11, 2022
3.5.5 Mar 28, 2022

#341 in Game dev

Download history 1/week @ 2024-02-15 7/week @ 2024-02-22 12/week @ 2024-02-29 64/week @ 2024-03-07

84 downloads per month
Used in draumaz-butterfly

MIT license

4KB

Savesys

A simple, expandable, variable-based save system.

Forked from the save system used in my other project, The Plains.

Functions

  • generate(SAVE_NAME: &'static str, num: i32) is self-explanatory.
  • exists(SAVE_NAME: &'static str) checks to see if the SAVE_NAME exists and returns the corresponding boolean.
  • reader(SAVE_NAME: &'static str) scans SAVE_NAME and returns the values per line into a Vec.
  • writer(SAVE_NAME: &'static str, line: usize, state: i32) scans the line and new number passed in, and writes to SAVE_NAME.

Example Usage

extern crate savesys;
use savesys::*;

if ! exists("data.txt") { generate("data.txt", 20) };

let save_vec: Vec<i32> = savesys::reader("data.txt");
if ! save_vec[5] == 7 { writer("data.txt", 5, 7) }

No runtime deps