Persist faction relationships in run checkpoints

This commit is contained in:
Meta Vens 2026-06-14 12:02:47 +01:00
commit e0a39b2fce
8 changed files with 73 additions and 6 deletions

View file

@ -423,6 +423,7 @@ public class ActionGameManager : MonoBehaviour
.OrderBy(index => index)
.ToArray() ?? Array.Empty<int>(),
ActionBarBindings = ProjectActionBarBindings(),
FactionRelationships = ProjectFactionRelationships(),
Zones = Zone == null ? Array.Empty<AetheriaRuntimeZoneSnapshotCommit>() : new[] { ProjectZoneSnapshot(Zone) }
};
}
@ -467,6 +468,20 @@ public class ActionGameManager : MonoBehaviour
}
}
private AetheriaRuntimeFactionRelationshipCommit[] ProjectFactionRelationships()
{
return CurrentGalaxy?.FactionRelationships?
.Where(pair => pair.Key != null)
.OrderBy(pair => pair.Key.ID)
.Select(pair => new AetheriaRuntimeFactionRelationshipCommit
{
CorporationLegacyId = pair.Key.ID == Guid.Empty ? "" : pair.Key.ID.ToString("D"),
Relationship = pair.Value.ToString(),
Standing = (int)pair.Value
})
.ToArray() ?? Array.Empty<AetheriaRuntimeFactionRelationshipCommit>();
}
private AetheriaRuntimeZoneSnapshotCommit ProjectZoneSnapshot(Zone zone)
{
var galaxyZone = zone.GalaxyZone;