Refactor station modules into typed runtime models
This commit is contained in:
@@ -796,14 +796,14 @@ internal sealed class SimulationProjectionService
|
||||
|
||||
private static IReadOnlyList<StationStorageUsageSnapshot> ToStationStorageUsageSnapshots(SimulationWorld world, StationRuntime station)
|
||||
{
|
||||
string[] storageClasses = ["solid", "liquid", "container", "manufactured"];
|
||||
return storageClasses
|
||||
.Select(storageClass => new StationStorageUsageSnapshot(
|
||||
storageClass,
|
||||
StorageKind[] storageKinds = [StorageKind.Solid, StorageKind.Liquid, StorageKind.Container];
|
||||
return storageKinds
|
||||
.Select(storageKind => new StationStorageUsageSnapshot(
|
||||
storageKind.ToDataValue(),
|
||||
station.Inventory
|
||||
.Where(entry => world.ItemDefinitions.TryGetValue(entry.Key, out var definition) && definition.CargoKind == storageClass)
|
||||
.Where(entry => world.ItemDefinitions.TryGetValue(entry.Key, out var definition) && definition.CargoStorageKind == storageKind)
|
||||
.Sum(entry => entry.Value),
|
||||
GetStationStorageCapacity(station, storageClass)))
|
||||
GetStationStorageCapacity(world, station, storageKind)))
|
||||
.Where(snapshot => snapshot.Capacity > 0.01f)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user