intermediate broken
This commit is contained in:
parent
c77ef68e70
commit
40cf280127
@ -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()
|
||||||
Destination = grouping.Key,
|
.Select(query =>
|
||||||
TotalIronium = grouping.Items.Sum(f => f.Ironium),
|
{
|
||||||
TotalBoranium = grouping.Items.Sum(f => f.Boranium),
|
var iro = query.Sum(f => f.Ironium);
|
||||||
TotalGermanium = grouping.Items.Sum(f => f.Germanium),
|
var bor = query.Sum(f => f.Boranium);
|
||||||
TotalColonists = grouping.Items.Sum(f => f.Colonists)
|
var ger = query.Sum(f => f.Germanium);
|
||||||
})
|
var col = query.Sum(f => f.Colonists);
|
||||||
.Sort(SortExpressionComparer<FleetSummary>.Ascending(f => f.Planet))
|
return new FleetSummary
|
||||||
.AsObservableChangeSet(summary => summary.Planet);
|
{
|
||||||
*/
|
Destination = group.GroupKey,
|
||||||
|
TotalIronium = iro,
|
||||||
|
TotalBoranium = bor,
|
||||||
|
TotalGermanium = ger,
|
||||||
|
TotalColonists = col
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <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);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user