Delete the old run, settings, layout and loadout authorities (Cut 10)
The deletion line lands before RunSave, as the spec orders. Deleted, not demoted: - PlayerSettings.SavedRun (Key 1 stays unclaimed) and the SavedGame constructor that upserted a fresh SavedZone per zone on every save. - ActionGameManager: the PlayerSettings.msgpack getter, file path and writer; the .loadout format (_loadoutPath, Loadouts, SaveLoadout and its default-options serializer, the commented loader); OnApplicationQuit and SaveState; SaveZone, which had no caller. - MainMenu's SavedRun Continue branch and both `SavedRun = null` writes. - InventoryPanel's Save Loadout and Restore Loadout bodies. - InputDisplayLayout's KeyboardLayouts file reader, ParseJson, AssociateInputKeys, SaveLayout and the usings they alone needed. - AetherDb's Cut 9 importer (Import.cs, legacy-census, import). - The three-gates note on loading writes; Cut 3 made loading non-writing. - .gitignore ignores GameData/run.cc and GameData/player.cc instead of PlayerSettings.msgpack. DOES NOT BUILD in Unity: ActionGameManager, MainMenu and InputDisplayLayout still reference the deleted members until the next commit wires RunSave, the settings getter and the catalog layout read. Headless builds. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
aa05a99617
commit
5c5c3d5e19
11 changed files with 6 additions and 508 deletions
|
|
@ -8,7 +8,6 @@ using MessagePack;
|
|||
public class PlayerSettings
|
||||
{
|
||||
[Key(0)] public string Name = "Anonymous";
|
||||
[Key(1)] public SavedGame SavedRun;
|
||||
[Key(2)] public bool TutorialPassed;
|
||||
[Key(3)] public Dictionary<string, string> HashedStoryFiles = new Dictionary<string, string>();
|
||||
[Key(4)] public PlayerGameplaySettings GameplaySettings = new PlayerGameplaySettings();
|
||||
|
|
|
|||
|
|
@ -48,40 +48,6 @@ public class SavedGame
|
|||
[Key(12)]
|
||||
public FactionRelationship[] Relationships;
|
||||
|
||||
public SavedGame() { }
|
||||
|
||||
// Writes a SavedZone record for every galaxy zone through the cache.
|
||||
public SavedGame(CultCache cache, Galaxy galaxy, Zone currentZone, Entity currentEntity)
|
||||
{
|
||||
DiscoveredZones = galaxy.DiscoveredZones.Select(dz => Array.IndexOf(galaxy.Zones, dz)).ToArray();
|
||||
Background = galaxy.Background;
|
||||
var factions = galaxy.HomeZones.Keys.ToArray();
|
||||
Factions = factions.Select(f => cache.RefOf(f)).ToArray();
|
||||
Relationships = galaxy.Factions.Select(f => galaxy.FactionRelationships[f]).ToArray();
|
||||
|
||||
HomeZones = galaxy.HomeZones.ToDictionary(
|
||||
x => Array.IndexOf(factions, x.Key),
|
||||
x => Array.IndexOf(galaxy.Zones, x.Value));
|
||||
BossZones = galaxy.BossZones.ToDictionary(
|
||||
x => Array.IndexOf(factions, x.Key),
|
||||
x => Array.IndexOf(galaxy.Zones, x.Value));
|
||||
|
||||
Zones = galaxy.Zones.Select(zone => cache.Upsert(new SavedZone
|
||||
{
|
||||
Name = zone.Name,
|
||||
Position = zone.Position,
|
||||
AdjacentZones = zone.AdjacentZones.Select(az=> Array.IndexOf(galaxy.Zones, az)).ToArray(),
|
||||
Factions = zone.Factions.Select(f=> Array.IndexOf(factions, f)).ToArray(),
|
||||
Contents = zone.Contents?.PackZone(),
|
||||
Owner = zone.Owner == null ? -1 : Array.IndexOf(factions, zone.Owner)
|
||||
})).ToArray();
|
||||
|
||||
CurrentZone = Array.FindIndex(galaxy.Zones, zone => zone.Contents == currentZone);
|
||||
CurrentZoneEntity = currentZone.Entities.IndexOf(currentEntity);
|
||||
|
||||
Entrance = Array.IndexOf(galaxy.Zones, galaxy.Entrance);
|
||||
Exit = Array.IndexOf(galaxy.Zones, galaxy.Exit);
|
||||
}
|
||||
}
|
||||
|
||||
[CultDocument("aetheria.savedzone", "1"), MessagePackObject]
|
||||
|
|
|
|||
Loading…
Reference in a new issue