Use item keys for body resources

This commit is contained in:
Meta Vens 2026-06-15 03:35:40 +01:00
commit 2d3172887b
7 changed files with 10 additions and 7 deletions

View file

@ -674,7 +674,7 @@ public class ActionGameManager : MonoBehaviour
.OrderBy(pair => pair.Key)
.Select(pair => new AetheriaRuntimeBodyResourceCommit
{
ItemKey = AetheriaRuntimeItemReference.FromLegacyId(pair.Key),
ItemKey = pair.Key ?? "",
Amount = pair.Value
})
.ToArray() ?? Array.Empty<AetheriaRuntimeBodyResourceCommit>(),
@ -705,7 +705,7 @@ public class ActionGameManager : MonoBehaviour
.OrderBy(pair => pair.Key)
.Select(pair => new AetheriaRuntimeBodyResourceCommit
{
ItemKey = AetheriaRuntimeItemReference.FromLegacyId(pair.Key),
ItemKey = pair.Key ?? "",
Amount = pair.Value
})
.ToArray() ?? Array.Empty<AetheriaRuntimeBodyResourceCommit>(),

View file

@ -370,7 +370,7 @@ public class Planet
public string Name { get; }
public Guid OrbitId { get; }
public float Mass { get; }
public IReadOnlyDictionary<Guid, float> Resources { get; }
public IReadOnlyDictionary<string, float> Resources { get; }
public float BodyRadiusMultiplier { get; }
public float GravityRadiusMultiplier { get; }
public float GravityDepthMultiplier { get; }
@ -475,7 +475,7 @@ public class AsteroidBelt
public string Name { get; }
public Guid Orbit { get; }
public float Mass { get; }
public IReadOnlyDictionary<Guid, float> Resources { get; }
public IReadOnlyDictionary<string, float> Resources { get; }
public float BodyRadiusMultiplier { get; }
public float GravityRadiusMultiplier { get; }
public float GravityDepthMultiplier { get; }

View file

@ -31,7 +31,7 @@ public abstract class BodyConstructionData : INamedEntry
public float Mass = 0;
public Dictionary<Guid, float> Resources = new Dictionary<Guid, float>();
public Dictionary<string, float> Resources = new Dictionary<string, float>();
public float BodyRadiusMultiplier = 1;

View file

@ -124,7 +124,7 @@ public static class ZoneGenerator
blueprint.Bodies = planets.Where(p=>!p.Empty).Select(planet =>
{
// Dictionary<Guid, float> planetResources = new Dictionary<Guid, float>();
// Dictionary<string, float> planetResources = new Dictionary<string, float>();
BodyType bodyType = planet.Belt ? BodyType.Asteroid :
planet.Mass > zoneSettings.SunMass ? BodyType.Sun :
planet.Mass > zoneSettings.GasGiantMass ? BodyType.GasGiant :