/// <summary> /// Determines whether or not the given file is a save file for Pokémon Mystery Dungeon: Explorers of Time and Darkness. /// </summary> /// <param name="file">The file to be checked</param> /// <returns>A boolean indicating whether or not the given file is supported by this class</returns> public virtual async Task <bool> IsOfType(GenericFile file) { if (file.Length > Offsets.ChecksumEnd) { return(await file.ReadUInt32Async(0) == Checksums.Calculate32BitChecksum(file, 4, Offsets.ChecksumEnd)); } else { return(false); } }
/// <summary> /// Calculates the checksum of the backup save /// </summary> public virtual uint CalculateSecondaryChecksum() { return(Checksums.Calculate32BitChecksum(Bits, Offsets.BackupSaveStart + 4, Offsets.BackupSaveStart + Offsets.ChecksumEnd)); }
/// <summary> /// Calculates the checksum of the primary save /// </summary> public virtual uint CalculatePrimaryChecksum() { return(Checksums.Calculate32BitChecksum(Bits, 4, Offsets.ChecksumEnd)); }
/// <summary> /// Calculates the checksum of the QuickSave /// </summary> public uint CalculateQuicksaveChecksum() { return(Checksums.Calculate32BitChecksum(Bits, Offsets.QuicksaveChecksumStart, Offsets.QuicksaveChecksumEnd)); }