Demote zone construction data names
This commit is contained in:
parent
7b605f049c
commit
bf03f27709
8 changed files with 69 additions and 51 deletions
Binary file not shown.
|
|
@ -6,7 +6,7 @@ namespace Microsoft.Msagl.Routing.Spline.Bundling {
|
|||
/// Outputs run time in debug mode
|
||||
/// </summary>
|
||||
internal class TimeMeasurer {
|
||||
#if DEBUG && TEST_MSAGL
|
||||
#if DEBUG && TEST_MSAGL && REPORTING
|
||||
static DebugHelpers.Timer timer;
|
||||
static TimeMeasurer() {
|
||||
timer = new DebugHelpers.Timer();
|
||||
|
|
@ -17,7 +17,7 @@ namespace Microsoft.Msagl.Routing.Spline.Bundling {
|
|||
internal delegate void Task();
|
||||
|
||||
internal static void DebugOutput(string str) {
|
||||
#if DEBUG && TEST_MSAGL
|
||||
#if DEBUG && TEST_MSAGL && REPORTING
|
||||
timer.Stop();
|
||||
Console.Write("{0}: ", String.Format("{0:0.000}", timer.Duration));
|
||||
Console.WriteLine(str);
|
||||
|
|
|
|||
|
|
@ -34,13 +34,17 @@ namespace MessagePack.Resolvers
|
|||
ForceSizePrimitiveObjectResolver.Instance, // Preserve particular integer types
|
||||
BuiltinResolver.Instance, // Try Builtin
|
||||
AttributeFormatterResolver.Instance, // Try use [MessagePackFormatter]
|
||||
#if !ENABLE_IL2CPP
|
||||
#if !ENABLE_IL2CPP && !NET_STANDARD_2_0
|
||||
DynamicEnumResolver.Instance, // Try Enum
|
||||
#endif
|
||||
#if !ENABLE_IL2CPP
|
||||
DynamicGenericResolver.Instance, // Try Array, Tuple, Collection
|
||||
#endif
|
||||
#if !ENABLE_IL2CPP && !NET_STANDARD_2_0
|
||||
DynamicUnionResolver.Instance, // Try Union(Interface)
|
||||
DynamicObjectResolver.Instance, // Try Object
|
||||
#endif
|
||||
DynamicContractlessObjectResolverAllowPrivate.Instance, // Serializes keys as strings
|
||||
#endif
|
||||
TypelessObjectResolver.Instance,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -58,17 +58,17 @@ public class Zone
|
|||
Orbits.Add(orbit.ID, new Orbit(Settings, orbit));
|
||||
}
|
||||
|
||||
foreach (var planet in blueprint.Planets)
|
||||
foreach (var planet in blueprint.Bodies)
|
||||
{
|
||||
switch (planet)
|
||||
{
|
||||
case AsteroidBeltData belt:
|
||||
case AsteroidBeltConstructionData belt:
|
||||
AsteroidBelts[belt.ID] = new AsteroidBelt(belt);
|
||||
break;
|
||||
case SunData sun:
|
||||
case SunConstructionData sun:
|
||||
PlanetInstances.Add(sun.ID, new Sun(settings, sun, Orbits[planet.Orbit]));
|
||||
break;
|
||||
case GasGiantData gas:
|
||||
case GasGiantConstructionData gas:
|
||||
PlanetInstances.Add(gas.ID, new GasGiant(settings, gas, Orbits[planet.Orbit]));
|
||||
break;
|
||||
default:
|
||||
|
|
@ -379,7 +379,7 @@ public class Planet
|
|||
public float GravityWellRadius;
|
||||
public float BodyRadius;
|
||||
|
||||
public Planet(PlanetSettings settings, BodyData data, Orbit orbit)
|
||||
public Planet(PlanetSettings settings, BodyConstructionData data, Orbit orbit)
|
||||
{
|
||||
Settings = settings;
|
||||
Orbit = orbit;
|
||||
|
|
@ -421,7 +421,7 @@ public class GasGiant : Planet
|
|||
public float GravityWavesRadius;
|
||||
public float GravityWavesSpeed;
|
||||
|
||||
public GasGiant(PlanetSettings settings, GasGiantData data, Orbit orbit) : base(settings, data, orbit)
|
||||
public GasGiant(PlanetSettings settings, GasGiantConstructionData data, Orbit orbit) : base(settings, data, orbit)
|
||||
{
|
||||
FirstOffsetDomainRotationSpeed = data.FirstOffsetDomainRotationSpeed;
|
||||
FirstOffsetRotationSpeed = data.FirstOffsetRotationSpeed;
|
||||
|
|
@ -453,7 +453,7 @@ public class Sun : GasGiant
|
|||
public float LightRadiusMultiplier { get; }
|
||||
public float LightRadius;
|
||||
|
||||
public Sun(PlanetSettings settings, SunData data, Orbit orbit) : base(settings, data, orbit)
|
||||
public Sun(PlanetSettings settings, SunConstructionData data, Orbit orbit) : base(settings, data, orbit)
|
||||
{
|
||||
LightColor = data.LightColor;
|
||||
FogTintColor = data.FogTintColor;
|
||||
|
|
@ -489,7 +489,7 @@ public class AsteroidBelt
|
|||
public Dictionary<int, float> Damage = new Dictionary<int, float>();
|
||||
public Dictionary<(Entity, int), float> MiningAccumulator = new Dictionary<(Entity, int), float>();
|
||||
|
||||
public AsteroidBelt(AsteroidBeltData data)
|
||||
public AsteroidBelt(AsteroidBeltConstructionData data)
|
||||
{
|
||||
_asteroids = data.Asteroids;
|
||||
ID = data.ID;
|
||||
|
|
@ -532,7 +532,7 @@ public class Orbit
|
|||
return new float2(cos(phase), sin(phase));
|
||||
}
|
||||
|
||||
public Orbit(PlanetSettings settings, OrbitData data)
|
||||
public Orbit(PlanetSettings settings, OrbitConstructionData data)
|
||||
{
|
||||
ID = data.ID;
|
||||
Parent = data.Parent;
|
||||
|
|
|
|||
|
|
@ -13,15 +13,15 @@ using float3 = Unity.Mathematics.float3;
|
|||
|
||||
public class ZoneConstructionBlueprint
|
||||
{
|
||||
public List<BodyData> Planets = new List<BodyData>();
|
||||
public List<OrbitData> Orbits = new List<OrbitData>();
|
||||
public List<BodyConstructionData> Bodies = new List<BodyConstructionData>();
|
||||
public List<OrbitConstructionData> Orbits = new List<OrbitConstructionData>();
|
||||
public List<EntityConstructionBlueprint> Entities = new List<EntityConstructionBlueprint>();
|
||||
public float Radius = 2000;
|
||||
public float Mass = 10000;
|
||||
public double Time;
|
||||
}
|
||||
|
||||
public abstract class BodyData : INamedEntry
|
||||
public abstract class BodyConstructionData : INamedEntry
|
||||
{
|
||||
public Guid ID = Guid.NewGuid();
|
||||
|
||||
|
|
@ -48,17 +48,17 @@ public abstract class BodyData : INamedEntry
|
|||
}
|
||||
}
|
||||
|
||||
public class PlanetData : BodyData
|
||||
public class PlanetConstructionData : BodyConstructionData
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class AsteroidBeltData : BodyData
|
||||
public class AsteroidBeltConstructionData : BodyConstructionData
|
||||
{
|
||||
public Asteroid[] Asteroids;
|
||||
}
|
||||
|
||||
public class GasGiantData : BodyData
|
||||
public class GasGiantConstructionData : BodyConstructionData
|
||||
{
|
||||
public float FirstOffsetDomainRotationSpeed = 1;
|
||||
|
||||
|
|
@ -83,7 +83,7 @@ public class GasGiantData : BodyData
|
|||
public float4[] Colors = new float4[0];
|
||||
}
|
||||
|
||||
public class SunData : GasGiantData
|
||||
public class SunConstructionData : GasGiantConstructionData
|
||||
{
|
||||
public float3 LightColor = float3.zero;
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ public class Asteroid
|
|||
public float RotationSpeed;
|
||||
}
|
||||
|
||||
public class OrbitData
|
||||
public class OrbitConstructionData
|
||||
{
|
||||
public Guid ID = Guid.NewGuid();
|
||||
|
||||
|
|
@ -94,13 +94,13 @@ public static class ZoneGenerator
|
|||
planets.AddRange(GenerateEntities(zoneSettings, ref random, blueprint.Mass, blueprint.Radius, float2.zero));
|
||||
|
||||
// Create collections to map between zone generator output and database entries
|
||||
var orbitMap = new Dictionary<GeneratorPlanet, OrbitData>();
|
||||
var orbitInverseMap = new Dictionary<OrbitData, GeneratorPlanet>();
|
||||
var orbitMap = new Dictionary<GeneratorPlanet, OrbitConstructionData>();
|
||||
var orbitInverseMap = new Dictionary<OrbitConstructionData, GeneratorPlanet>();
|
||||
|
||||
// Create orbit database entries
|
||||
blueprint.Orbits = planets.Select(planet =>
|
||||
{
|
||||
var data = new OrbitData
|
||||
var data = new OrbitConstructionData
|
||||
{
|
||||
FixedPosition = planet.FixedPosition,
|
||||
Distance = planet.Distance,
|
||||
|
|
@ -112,7 +112,7 @@ public static class ZoneGenerator
|
|||
return data;
|
||||
}).ToList();
|
||||
|
||||
// Link OrbitData parents to database GUIDs
|
||||
// Link orbit construction parents to generated orbit IDs.
|
||||
foreach (var data in blueprint.Orbits)
|
||||
data.Parent = orbitInverseMap[data].Parent != null
|
||||
? orbitMap[orbitInverseMap[data].Parent].ID
|
||||
|
|
@ -122,7 +122,7 @@ public static class ZoneGenerator
|
|||
// var resourceMaps = mapLayers.Values
|
||||
// .ToDictionary(m => m.ID, m => m.Evaluate(zone.Position, settings.ShapeSettings));
|
||||
|
||||
blueprint.Planets = planets.Where(p=>!p.Empty).Select(planet =>
|
||||
blueprint.Bodies = planets.Where(p=>!p.Empty).Select(planet =>
|
||||
{
|
||||
// Dictionary<Guid, float> planetResources = new Dictionary<Guid, float>();
|
||||
BodyType bodyType = planet.Belt ? BodyType.Asteroid :
|
||||
|
|
@ -139,21 +139,21 @@ public static class ZoneGenerator
|
|||
// }
|
||||
// }
|
||||
|
||||
BodyData planetData;
|
||||
BodyConstructionData planetData;
|
||||
switch (bodyType)
|
||||
{
|
||||
case BodyType.Asteroid:
|
||||
planetData = new AsteroidBeltData();
|
||||
planetData = new AsteroidBeltConstructionData();
|
||||
break;
|
||||
case BodyType.Planetoid:
|
||||
case BodyType.Planet:
|
||||
planetData = new PlanetData();
|
||||
planetData = new PlanetConstructionData();
|
||||
break;
|
||||
case BodyType.GasGiant:
|
||||
planetData = new GasGiantData();
|
||||
planetData = new GasGiantConstructionData();
|
||||
break;
|
||||
case BodyType.Sun:
|
||||
planetData = new SunData();
|
||||
planetData = new SunConstructionData();
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
|
|
@ -163,7 +163,7 @@ public static class ZoneGenerator
|
|||
planetData.Orbit = orbitMap[planet].ID;
|
||||
// planetData.Resources = planetResources;
|
||||
planetData.Name = planetData.ID.ToString().Substring(0, 8);
|
||||
if (planetData is AsteroidBeltData beltData)
|
||||
if (planetData is AsteroidBeltConstructionData beltData)
|
||||
{
|
||||
beltData.Asteroids =
|
||||
Enumerable.Range(0, (int) zoneSettings.AsteroidCount.Evaluate(beltData.Mass * orbitMap[planet].Distance))
|
||||
|
|
@ -177,9 +177,9 @@ public static class ZoneGenerator
|
|||
//.OrderByDescending(a=>a.Size)
|
||||
.ToArray();
|
||||
}
|
||||
else if (planetData is GasGiantData gas)
|
||||
else if (planetData is GasGiantConstructionData gas)
|
||||
{
|
||||
if (gas is SunData sun)
|
||||
if (gas is SunConstructionData sun)
|
||||
{
|
||||
float primary = random.NextFloat();
|
||||
float secondary = frac(primary + 1 + zoneSettings.SunSecondaryColorDistance * (random.NextFloat() > .5 ? 1 : -1));
|
||||
|
|
@ -250,9 +250,9 @@ public static class ZoneGenerator
|
|||
return loadoutGenerators[faction];
|
||||
}
|
||||
|
||||
OrbitData CreateLagrangeOrbit(OrbitData baseOrbit)
|
||||
OrbitConstructionData CreateLagrangeOrbit(OrbitConstructionData baseOrbit)
|
||||
{
|
||||
var lagrangeOrbit = new OrbitData
|
||||
var lagrangeOrbit = new OrbitConstructionData
|
||||
{
|
||||
ID = Guid.NewGuid(),
|
||||
Parent = baseOrbit.Parent,
|
||||
|
|
@ -263,11 +263,11 @@ public static class ZoneGenerator
|
|||
return lagrangeOrbit;
|
||||
}
|
||||
|
||||
void PlaceTurret(OrbitData orbit, LoadoutGenerator loadoutGenerator, int distanceMultiplier)
|
||||
void PlaceTurret(OrbitConstructionData orbit, LoadoutGenerator loadoutGenerator, int distanceMultiplier)
|
||||
{
|
||||
var phase = 20f * distanceMultiplier / orbit.Distance;
|
||||
|
||||
var turretOrbit = new OrbitData
|
||||
var turretOrbit = new OrbitConstructionData
|
||||
{
|
||||
ID = Guid.NewGuid(),
|
||||
Parent = orbit.Parent,
|
||||
|
|
@ -281,7 +281,7 @@ public static class ZoneGenerator
|
|||
blueprint.Entities.Add(turret);
|
||||
}
|
||||
|
||||
void PlaceTurrets(OrbitData orbit, LoadoutGenerator loadoutGenerator, int count)
|
||||
void PlaceTurrets(OrbitConstructionData orbit, LoadoutGenerator loadoutGenerator, int count)
|
||||
{
|
||||
for(int t=0; t<count; t++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -540,7 +540,7 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted.
|
|||
- `AgentTask` has been cut loose from the item projection base; AI tasks are
|
||||
local runtime work orders and no longer participate in the shared projection
|
||||
identity base.
|
||||
- `BodyData` and `OrbitData` have also been cut loose from
|
||||
- `BodyConstructionData` and `OrbitConstructionData` have also been cut loose from
|
||||
the item projection base; they keep local GUID fields for zone runtime lookup,
|
||||
but no longer inherit shared projection equality.
|
||||
- `Faction` has been cut loose from the item projection base; it keeps local
|
||||
|
|
@ -1025,27 +1025,27 @@ First Aetheria surfaces to publish:
|
|||
commented thruster sound-trigger code; those paths had no live output and
|
||||
therefore earned deletion rather than a new runtime metadata owner.
|
||||
- Done: move runtime orbit parent/phase/distance/fixed-position reads off
|
||||
`OrbitData`; `Zone`, `ActionGameManager`, and `ZoneRenderer` consume
|
||||
`OrbitConstructionData`; `Zone`, `ActionGameManager`, and `ZoneRenderer` consume
|
||||
`Orbit` runtime properties, and the old `Orbit.ToData()` construction
|
||||
capture bridge is deleted.
|
||||
- Done: move orbit phase evaluation off `OrbitData`; runtime zone updates,
|
||||
- Done: move orbit phase evaluation off `OrbitConstructionData`; runtime zone updates,
|
||||
asteroid transforms, and generator rosette spacing now use `Orbit.Evaluate`,
|
||||
leaving `OrbitData` as a construction row only.
|
||||
leaving `OrbitConstructionData` as a construction input only.
|
||||
- Done: rename `OrbitalEntity.OrbitData` to `OrbitId` and delete the unused
|
||||
`Zone.CreateOrbit` construction-row writer; runtime entities no longer
|
||||
expose an orbit id through DTO-shaped naming.
|
||||
- Done: move live asteroid-belt simulation, scanning, and mesh setup reads
|
||||
off `AsteroidBeltData`; `Zone`, `ResourceScanner`, and `AsteroidBeltUI`
|
||||
off `AsteroidBeltConstructionData`; `Zone`, `ResourceScanner`, and `AsteroidBeltUI`
|
||||
consume `AsteroidBelt` runtime asteroid/resource/orbit properties, and
|
||||
the old `AsteroidBelt.ToData()` construction capture bridge is deleted.
|
||||
- Done: move live planet mass/orbit/gravity reads off `BodyData`; `Zone`
|
||||
- Done: move live planet mass/orbit/gravity reads off `BodyConstructionData`; `Zone`
|
||||
gravity evaluation and `ZoneRenderer` consume `Planet` runtime properties,
|
||||
and the old `Planet.ToData()` construction capture bridge is deleted.
|
||||
- Done: move typed zone orbit snapshot projection off
|
||||
construction-blueprint orbit rows; run checkpoint commits now project current
|
||||
`Zone.Orbits` runtime wrappers into typed orbit snapshot rows.
|
||||
- Done: move typed zone body snapshot projection off `BodyData` and
|
||||
`AsteroidBeltData`; run checkpoint commits now project `Planet` and
|
||||
- Done: move typed zone body snapshot projection off `BodyConstructionData` and
|
||||
`AsteroidBeltConstructionData`; run checkpoint commits now project `Planet` and
|
||||
`AsteroidBelt` runtime wrappers, including body resources, asteroid
|
||||
runtime damage/respawn/miner accumulators, and gas/sun visual fields.
|
||||
- Done: move visited-sector summary counts off construction-blueprint
|
||||
|
|
@ -1055,14 +1055,14 @@ First Aetheria surfaces to publish:
|
|||
- Done: delete `GalaxyZone.RuntimeBlueprint` as a persistent zone-side cache;
|
||||
unvisited zone generation now feeds the `Zone` constructor directly, and
|
||||
visited zone state is owned by `GalaxyZone.Contents`/`Zone.CaptureBlueprint`.
|
||||
- Done: delete the `Zone.Planets` `BodyData` shadow dictionary; orbit
|
||||
- Done: delete the `Zone.Planets` `BodyConstructionData` shadow dictionary; orbit
|
||||
targeting, resource scanning, and zone capture now read `PlanetInstances`
|
||||
and `AsteroidBelts` runtime wrappers, with DTOs retained only as
|
||||
construction/capture payloads.
|
||||
- Done: move `ZoneRenderer` body classification off `BodyData` subclasses;
|
||||
- Done: move `ZoneRenderer` body classification off `BodyConstructionData` subclasses;
|
||||
zone rendering now walks runtime orbits and lowers `Planet`, `GasGiant`,
|
||||
`Sun`, and `AsteroidBelt` wrappers directly.
|
||||
- Done: remove public `GasGiantData`/`SunData` handles from runtime wrappers;
|
||||
- Done: remove public `GasGiantConstructionData`/`SunConstructionData` handles from runtime wrappers;
|
||||
wave and light calculations now use copied wrapper fields after
|
||||
construction.
|
||||
- Done: move saved loadout template ownership off `EntityConstructionBlueprint`;
|
||||
|
|
@ -1324,9 +1324,14 @@ First Aetheria surfaces to publish:
|
|||
`EntityConstructionBlueprintProjector`; it captures/instantiates
|
||||
construction blueprint projections and no longer presents itself as a
|
||||
serializer or runtime-state owner.
|
||||
- Done: delete the unused `Zone.AddOrbit(OrbitData)` construction-row
|
||||
- Done: delete the unused `Zone.AddOrbit(OrbitConstructionData)` construction-row
|
||||
writer; zone orbit construction flows through `ZoneConstructionBlueprint`
|
||||
only.
|
||||
- Done: rename zone body/orbit construction DTOs to
|
||||
`BodyConstructionData`/`OrbitConstructionData` and move `ZoneData.cs` to
|
||||
`ZoneConstructionData.cs`; the construction blueprint now exposes
|
||||
`Bodies` rather than a planet list that also contained belts, gas giants,
|
||||
and suns.
|
||||
- Done: demote Unity's live `PlayerSettings` runtime object to
|
||||
`RuntimePlayerSettings`; `AetheriaPlayerSettings` remains the typed Verse
|
||||
state document owner, while Unity only keeps a session projection and
|
||||
|
|
@ -1405,6 +1410,15 @@ First Aetheria surfaces to publish:
|
|||
- Entity construction blueprint projection no longer uses the `EntitySerializer`
|
||||
or runtime-state authority names; live Unity source calls
|
||||
`EntityConstructionBlueprintProjector`.
|
||||
- Vendored Unity `MessagePack` remains a low-level codec boundary only; its
|
||||
typeless contractless resolver now follows the same `NET_STANDARD_2_0`
|
||||
dynamic-resolver guards as `StandardResolver`, so Unity batchmode cannot
|
||||
resurrect unsupported typeless dynamic code while compiling the quarantined
|
||||
assembly.
|
||||
- Vendored Unity `MSAGL` debug timing remains diagnostic-only; `TimeMeasurer`
|
||||
now requires the same `REPORTING` symbol that defines
|
||||
`Microsoft.Msagl.DebugHelpers.Timer`, so `TEST_MSAGL` cannot accidentally
|
||||
summon a missing debug dependency during Unity compilation.
|
||||
- Unity runtime settings projection is now `RuntimePlayerSettings`; live Unity
|
||||
source has no standalone `PlayerSettings` class/property/method symbols.
|
||||
- Input binding and action-bar edits now queue the same typed player-settings
|
||||
|
|
|
|||
Loading…
Reference in a new issue