Files

31 lines
1.3 KiB
C#
Raw Permalink Normal View History

namespace Theriapolis.Core.Persistence.SaveMigrations;
/// <summary>
/// Phase 6.5 M0 — additive migration from save schema v6 (Phase 6 ship) to
/// v7 (Phase 6.5 levelling). Non-destructive: every v6 field carries over
/// unchanged. The new <see cref="PlayerCharacterState.SubclassId"/>,
/// <see cref="PlayerCharacterState.LearnedFeatureIds"/>, and
/// <see cref="PlayerCharacterState.LevelUpHistory"/> default-initialise
/// to empty values by the constructor, so this migration just bumps the
/// header version.
///
/// Phase-6 saves had no level-up history (every character stayed at level
/// 1, Xp = 0). On load they continue to be valid level-1 characters; the
/// player can immediately start earning XP and levelling up under the new
/// rules.
/// </summary>
public sealed class V6ToV7Migration : ISaveMigration
{
public int FromVersion => 6;
public int ToVersion => 7;
public void Apply(SaveHeader header, SaveBody body)
{
// No data translation needed. PlayerCharacterState's new fields
// (SubclassId, LearnedFeatureIds, LevelUpHistory) default-initialise
// to empty in their record, and SaveCodec.ReadCharacter handles
// missing-section bytes via the EOS-check pattern Phase 5 already
// established. Pure version bump.
}
}