| Crates.io | savesys |
| lib.rs | savesys |
| version | 3.5.11 |
| created_at | 2022-03-27 21:16:55.099853+00 |
| updated_at | 2022-08-03 05:09:53.467043+00 |
| description | Variable-based save management system |
| homepage | |
| repository | |
| max_upload_size | |
| id | 557448 |
| size | 3,300 |
A simple, expandable, variable-based save system.
Forked from the save system used in my other project, The Plains.
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 Vecwriter(SAVE_NAME: &'static str, line: usize, state: i32) scans the line and new number passed in, and writes to SAVE_NAME.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) }