mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
feat(uxassist): generate blueprint production descriptions
Add native blueprint description generation with proliferation controls, separate power categories, and steady-state material and research reporting. Distinguish necessary coproducts from overbuild and fractional headroom, with regression checks and updated architecture documentation. Validation: 464 ProductionCheck checks and Release builds of UXAssist, CheatEnabler, and UniverseGenTweaks.
This commit is contained in:
1 parent
cada02fbf4
commit
e2b8433252
16 files changed
+2294
-51
No files matched your search
@@ -44,6 +44,25 @@ public sealed class ProductionPower
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ProductionPowerBreakdown
|
||||
{
|
||||
public double KnownFactoryConsumptionWatts { get; }
|
||||
public double KnownLogisticsConsumptionWatts { get; }
|
||||
public bool FactoryComplete { get; }
|
||||
public bool LogisticsComplete { get; }
|
||||
public double? FactoryConsumptionWatts => FactoryComplete ? KnownFactoryConsumptionWatts : null;
|
||||
public double? LogisticsConsumptionWatts => LogisticsComplete ? KnownLogisticsConsumptionWatts : null;
|
||||
|
||||
public ProductionPowerBreakdown(double knownFactoryConsumptionWatts, double knownLogisticsConsumptionWatts,
|
||||
bool factoryComplete, bool logisticsComplete)
|
||||
{
|
||||
KnownFactoryConsumptionWatts = knownFactoryConsumptionWatts;
|
||||
KnownLogisticsConsumptionWatts = knownLogisticsConsumptionWatts;
|
||||
FactoryComplete = factoryComplete;
|
||||
LogisticsComplete = logisticsComplete;
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ProductionItemFlow
|
||||
{
|
||||
public int ItemId { get; }
|
||||
@@ -55,9 +74,14 @@ public sealed class ProductionItemFlow
|
||||
public double Delivered { get; }
|
||||
public double Surplus { get; }
|
||||
public double RequiredExternalSupply { get; }
|
||||
public double? SteadyStateExternalSupply { get; }
|
||||
public bool IsFinalProduct { get; }
|
||||
public bool IsResearchProduct { get; }
|
||||
public bool IsExcessIntermediate { get; }
|
||||
public double SingleBuildingSurplusThreshold { get; }
|
||||
public double IntermediateShortage { get; }
|
||||
public double? OverbuildSurplus { get; }
|
||||
public double? CoproductSurplus { get; }
|
||||
public IReadOnlyList<int> ProducerGroups { get; }
|
||||
public IReadOnlyList<int> ConsumerGroups { get; }
|
||||
|
||||
@@ -65,6 +89,18 @@ public sealed class ProductionItemFlow
|
||||
double knownExternalSupply, double delivered, double surplus, double requiredExternalSupply,
|
||||
bool isFinalProduct, bool isExcessIntermediate, double singleBuildingSurplusThreshold,
|
||||
IEnumerable<int> producerGroups, IEnumerable<int> consumerGroups)
|
||||
: this(itemId, grossProduction, grossConsumption, externalImports, knownExternalSupply, delivered, surplus,
|
||||
requiredExternalSupply, isFinalProduct, isExcessIntermediate, singleBuildingSurplusThreshold,
|
||||
producerGroups, consumerGroups, 0, null, null)
|
||||
{
|
||||
}
|
||||
|
||||
public ProductionItemFlow(int itemId, double grossProduction, double grossConsumption, double externalImports,
|
||||
double knownExternalSupply, double delivered, double surplus, double requiredExternalSupply,
|
||||
bool isFinalProduct, bool isExcessIntermediate, double singleBuildingSurplusThreshold,
|
||||
IEnumerable<int> producerGroups, IEnumerable<int> consumerGroups, double intermediateShortage,
|
||||
double? overbuildSurplus, double? coproductSurplus, double? steadyStateExternalSupply = null,
|
||||
bool isResearchProduct = false)
|
||||
{
|
||||
ItemId = itemId;
|
||||
GrossProduction = grossProduction;
|
||||
@@ -74,9 +110,14 @@ public sealed class ProductionItemFlow
|
||||
Delivered = delivered;
|
||||
Surplus = surplus;
|
||||
RequiredExternalSupply = requiredExternalSupply;
|
||||
SteadyStateExternalSupply = steadyStateExternalSupply;
|
||||
IsFinalProduct = isFinalProduct;
|
||||
IsResearchProduct = isResearchProduct;
|
||||
IsExcessIntermediate = isExcessIntermediate;
|
||||
SingleBuildingSurplusThreshold = singleBuildingSurplusThreshold;
|
||||
IntermediateShortage = intermediateShortage;
|
||||
OverbuildSurplus = overbuildSurplus;
|
||||
CoproductSurplus = coproductSurplus;
|
||||
ProducerGroups = Array.AsReadOnly(producerGroups.ToArray());
|
||||
ConsumerGroups = Array.AsReadOnly(consumerGroups.ToArray());
|
||||
}
|
||||
@@ -136,12 +177,21 @@ public sealed class ProductionReport
|
||||
public IReadOnlyList<ProductionGroupFlow> Groups { get; }
|
||||
public IReadOnlyList<ProductionDiagnostic> Diagnostics { get; }
|
||||
public ProductionPower Power { get; }
|
||||
public ProductionPowerBreakdown PowerBreakdown { get; }
|
||||
public double LaunchesPerMinute => Groups.Sum(group => group.LaunchesPerMinute);
|
||||
public double ResearchHashesPerMinute => Groups.Sum(group => group.ResearchHashesPerMinute);
|
||||
|
||||
public ProductionReport(ProductionStatus status, bool materialComplete, bool powerComplete,
|
||||
IEnumerable<ProductionItemFlow> itemFlows, IEnumerable<ProductionGroupFlow> groups,
|
||||
IEnumerable<ProductionDiagnostic> diagnostics, ProductionPower power)
|
||||
: this(status, materialComplete, powerComplete, itemFlows, groups, diagnostics, power, null)
|
||||
{
|
||||
}
|
||||
|
||||
public ProductionReport(ProductionStatus status, bool materialComplete, bool powerComplete,
|
||||
IEnumerable<ProductionItemFlow> itemFlows, IEnumerable<ProductionGroupFlow> groups,
|
||||
IEnumerable<ProductionDiagnostic> diagnostics, ProductionPower power,
|
||||
ProductionPowerBreakdown powerBreakdown)
|
||||
{
|
||||
Status = status;
|
||||
MaterialComplete = materialComplete;
|
||||
@@ -150,6 +200,7 @@ public sealed class ProductionReport
|
||||
Groups = Array.AsReadOnly(groups.ToArray());
|
||||
Diagnostics = Array.AsReadOnly(diagnostics.ToArray());
|
||||
Power = power;
|
||||
PowerBreakdown = powerBreakdown;
|
||||
}
|
||||
|
||||
internal static ProductionReport Failure(ProductionDiagnostic diagnostic)
|
||||
|
||||
Reference in new issue
Block a user