/// <summary> /// Loads a score asynchronously from the given datasource /// </summary> /// <param name="path">the source path to load the binary file from</param> /// <param name="success">this function is called if the Score was successfully loaded from the datasource</param> /// <param name="error">this function is called if any error during the loading occured.</param> public static void LoadScoreAsync(string path, Action <Score> success, Action <Exception> error) { IFileLoader loader = Environment.FileLoaders["default"](); loader.LoadBinaryAsync(path, data => { Score score = null; try { score = LoadScoreFromBytes(data); } catch (Exception e) { error(e); } if (score != null) { success(score); } }, error); }