intermediate broken

This commit is contained in:
Torben Nehmer 2024-10-05 18:47:53 +02:00
parent c77ef68e70
commit 40cf280127
No known key found for this signature in database

View File

@ -17,7 +17,7 @@ public class FleetManager
/// <summary> /// <summary>
/// SourceCache for DynamicData views /// SourceCache for DynamicData views
/// </summary> /// </summary>
private SourceCache<Fleet, int> _fleets = new(f => f.Id); private SourceList<Fleet> _fleets = new();
public FleetManager() {} public FleetManager() {}
@ -33,20 +33,27 @@ public class FleetManager
public void test() public void test()
{ {
/* var xxxxx = _fleets.Connect()
_fleetSummaries = _fleets.Connect() .GroupOn(fleet => fleet.TrueDestination)
.Group(fleet => fleet.TrueDestination) .Transform(group =>
.Transform(grouping => new FleetSummary group.List.Connect()
.ToCollection()
.Select(query =>
{ {
Destination = grouping.Key, var iro = query.Sum(f => f.Ironium);
TotalIronium = grouping.Items.Sum(f => f.Ironium), var bor = query.Sum(f => f.Boranium);
TotalBoranium = grouping.Items.Sum(f => f.Boranium), var ger = query.Sum(f => f.Germanium);
TotalGermanium = grouping.Items.Sum(f => f.Germanium), var col = query.Sum(f => f.Colonists);
TotalColonists = grouping.Items.Sum(f => f.Colonists) return new FleetSummary
{
Destination = group.GroupKey,
TotalIronium = iro,
TotalBoranium = bor,
TotalGermanium = ger,
TotalColonists = col
};
}) })
.Sort(SortExpressionComparer<FleetSummary>.Ascending(f => f.Planet)) );
.AsObservableChangeSet(summary => summary.Planet);
*/
} }
/// <summary> /// <summary>
@ -60,7 +67,7 @@ public class FleetManager
_fleets.Edit(innerCache => _fleets.Edit(innerCache =>
{ {
innerCache.Clear(); innerCache.Clear();
innerCache.AddOrUpdate(allFleets); innerCache.Add(allFleets);
} }
); );
} }