Skip to main content

load

Function load 

Source
pub fn load(
    storage: &mut dyn Storage,
    old_keys: &[String],
    numbered: impl Fn(u32) -> String,
) -> (Profiles, Vec<String>)
Expand description

The list of profiles in storage, and warnings for the platform to log.

  • Saved: that list.
  • None saved (a first launch, or a player from before the game had profiles): one profile called numbered(1), with the player’s keys from before profiles (old_keys: those the game kept them under) moved into it (migrate).
  • Saved but unreadable: a profile for each that has keys in storage, called numbered(id), so no save is lost; with none, as if none was saved.
  • storage can’t be read: one profile, for this launch only; nothing is written.