Replace arbitrary game units with real-world measurements throughout the simulation and viewer: planet orbits in AU, sizes in km, galaxy positions in light-years. Add SimulationUnits helpers for conversions, separate WarpSpeed from FtlSpeed for ships, fix FTL transit progress to use galaxy-space distances, overhaul Lagrange point placement with Hill sphere approximation, and update the viewer to scale and format all distances correctly. Ships in FTL transit now render in galaxy view. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
191 lines
6.5 KiB
C#
191 lines
6.5 KiB
C#
namespace SpaceGame.Simulation.Api.Data;
|
|
|
|
public sealed class BalanceDefinition
|
|
{
|
|
public float YPlane { get; set; }
|
|
public float ArrivalThreshold { get; set; }
|
|
public float MiningRate { get; set; }
|
|
public float MiningCycleSeconds { get; set; }
|
|
public float TransferRate { get; set; }
|
|
public float DockingDuration { get; set; }
|
|
public float UndockingDuration { get; set; }
|
|
public float UndockDistance { get; set; }
|
|
public EnergyBalanceDefinition Energy { get; set; } = new();
|
|
}
|
|
|
|
public sealed class EnergyBalanceDefinition
|
|
{
|
|
public float IdleDrain { get; set; }
|
|
public float MoveDrain { get; set; }
|
|
public float WarpDrain { get; set; }
|
|
public float ShipRechargeRate { get; set; }
|
|
public float StationSolarCharge { get; set; }
|
|
}
|
|
|
|
public sealed class SolarSystemDefinition
|
|
{
|
|
public required string Id { get; set; }
|
|
public required string Label { get; set; }
|
|
public required float[] Position { get; set; }
|
|
public string StarKind { get; set; } = "main-sequence";
|
|
public int StarCount { get; set; } = 1;
|
|
public required string StarColor { get; set; }
|
|
public required string StarGlow { get; set; }
|
|
public float StarSize { get; set; }
|
|
public float GravityWellRadius { get; set; }
|
|
public required AsteroidFieldDefinition AsteroidField { get; set; }
|
|
public required List<ResourceNodeDefinition> ResourceNodes { get; set; }
|
|
public required List<PlanetDefinition> Planets { get; set; }
|
|
}
|
|
|
|
public sealed class AsteroidFieldDefinition
|
|
{
|
|
public int DecorationCount { get; set; }
|
|
public float RadiusOffset { get; set; }
|
|
public float RadiusVariance { get; set; }
|
|
public float HeightVariance { get; set; }
|
|
}
|
|
|
|
public sealed class ResourceNodeDefinition
|
|
{
|
|
public string SourceKind { get; set; } = "asteroid-belt";
|
|
public float Angle { get; set; }
|
|
public float RadiusOffset { get; set; }
|
|
public float InclinationDegrees { get; set; }
|
|
public int? AnchorPlanetIndex { get; set; }
|
|
public int? AnchorMoonIndex { get; set; }
|
|
public float OreAmount { get; set; }
|
|
public required string ItemId { get; set; }
|
|
public int ShardCount { get; set; }
|
|
}
|
|
|
|
public sealed class ItemDefinition
|
|
{
|
|
public required string Id { get; set; }
|
|
public required string Label { get; set; }
|
|
public required string Storage { get; set; }
|
|
public string Summary { get; set; } = string.Empty;
|
|
}
|
|
|
|
public sealed class RecipeInputDefinition
|
|
{
|
|
public required string ItemId { get; set; }
|
|
public float Amount { get; set; }
|
|
}
|
|
|
|
public sealed class ModuleRecipeDefinition
|
|
{
|
|
public required string ModuleId { get; set; }
|
|
public float Duration { get; set; }
|
|
public required List<RecipeInputDefinition> Inputs { get; set; }
|
|
}
|
|
|
|
public sealed class RecipeOutputDefinition
|
|
{
|
|
public required string ItemId { get; set; }
|
|
public float Amount { get; set; }
|
|
}
|
|
|
|
public sealed class RecipeDefinition
|
|
{
|
|
public required string Id { get; set; }
|
|
public required string Label { get; set; }
|
|
public required string FacilityCategory { get; set; }
|
|
public float Duration { get; set; }
|
|
public int Priority { get; set; }
|
|
public List<string> RequiredModules { get; set; } = [];
|
|
public List<RecipeInputDefinition> Inputs { get; set; } = [];
|
|
public List<RecipeOutputDefinition> Outputs { get; set; } = [];
|
|
public string? ShipOutputId { get; set; }
|
|
}
|
|
|
|
public sealed class PlanetDefinition
|
|
{
|
|
public required string Label { get; set; }
|
|
public string PlanetType { get; set; } = "terrestrial";
|
|
public string Shape { get; set; } = "sphere";
|
|
public int MoonCount { get; set; }
|
|
public float OrbitRadius { get; set; }
|
|
public float OrbitSpeed { get; set; }
|
|
public float OrbitEccentricity { get; set; }
|
|
public float OrbitInclination { get; set; }
|
|
public float OrbitLongitudeOfAscendingNode { get; set; }
|
|
public float OrbitArgumentOfPeriapsis { get; set; }
|
|
public float OrbitPhaseAtEpoch { get; set; }
|
|
public float Size { get; set; }
|
|
public required string Color { get; set; }
|
|
public float Tilt { get; set; }
|
|
public bool HasRing { get; set; }
|
|
}
|
|
|
|
public sealed class ShipDefinition
|
|
{
|
|
public required string Id { get; set; }
|
|
public required string Label { get; set; }
|
|
public required string Role { get; set; }
|
|
public required string ShipClass { get; set; }
|
|
public float Speed { get; set; }
|
|
public float WarpSpeed { get; set; }
|
|
public float FtlSpeed { get; set; }
|
|
public float SpoolTime { get; set; }
|
|
public float CargoCapacity { get; set; }
|
|
public string? CargoKind { get; set; }
|
|
public string? CargoItemId { get; set; }
|
|
public required string Color { get; set; }
|
|
public required string HullColor { get; set; }
|
|
public float Size { get; set; }
|
|
public float MaxHealth { get; set; }
|
|
public List<string> Modules { get; set; } = [];
|
|
}
|
|
|
|
public sealed class ConstructibleDefinition
|
|
{
|
|
public required string Id { get; set; }
|
|
public required string Label { get; set; }
|
|
public required string Category { get; set; }
|
|
public required string Color { get; set; }
|
|
public float Radius { get; set; }
|
|
public int DockingCapacity { get; set; }
|
|
public Dictionary<string, float> Storage { get; set; } = new(StringComparer.Ordinal);
|
|
public List<string> Modules { get; set; } = [];
|
|
}
|
|
|
|
public sealed class ScenarioDefinition
|
|
{
|
|
public required List<InitialStationDefinition> InitialStations { get; set; }
|
|
public required List<ShipFormationDefinition> ShipFormations { get; set; }
|
|
public required List<PatrolRouteDefinition> PatrolRoutes { get; set; }
|
|
public required MiningDefaultsDefinition MiningDefaults { get; set; }
|
|
}
|
|
|
|
public sealed class InitialStationDefinition
|
|
{
|
|
public required string ConstructibleId { get; set; }
|
|
public required string SystemId { get; set; }
|
|
public string? FactionId { get; set; }
|
|
public int? PlanetIndex { get; set; }
|
|
public int? LagrangeSide { get; set; }
|
|
public float[]? Position { get; set; }
|
|
}
|
|
|
|
public sealed class ShipFormationDefinition
|
|
{
|
|
public required string ShipId { get; set; }
|
|
public int Count { get; set; }
|
|
public required float[] Center { get; set; }
|
|
public required string SystemId { get; set; }
|
|
public string? FactionId { get; set; }
|
|
}
|
|
|
|
public sealed class PatrolRouteDefinition
|
|
{
|
|
public required string SystemId { get; set; }
|
|
public required List<float[]> Points { get; set; }
|
|
}
|
|
|
|
public sealed class MiningDefaultsDefinition
|
|
{
|
|
public required string NodeSystemId { get; set; }
|
|
public required string RefinerySystemId { get; set; }
|
|
}
|