-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring for production summary group support
- Loading branch information
1 parent
14a7e60
commit 5357add
Showing
4 changed files
with
157 additions
and
80 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
YAFC/Workspace/ProductionSummary/ProductionSummaryFlatHierarchy.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using YAFC.Model; | ||
using YAFC.UI; | ||
|
||
namespace YAFC | ||
{ | ||
public class ProductionSummaryFlatHierarchy : FlatHierarchy<ProductionSummaryEntry, ProductionSummaryGroup> | ||
{ | ||
public ProductionSummaryFlatHierarchy(DataGrid<ProductionSummaryEntry> grid, Action<ImGui, ProductionSummaryGroup> drawTableHeader) : base(grid, drawTableHeader) {} | ||
protected override bool Expanded(ProductionSummaryGroup group) => group.expanded; | ||
protected override ProductionSummaryGroup Subgroup(ProductionSummaryEntry row) => row.group; | ||
protected override List<ProductionSummaryEntry> Elements(ProductionSummaryGroup @group) => group.list; | ||
protected override void SetOwner(ProductionSummaryEntry row, ProductionSummaryGroup newOwner) => row.SetOwner(newOwner); | ||
protected override bool Filter(ProductionSummaryEntry row) => row.filterMatch; | ||
protected override string emptyGroupMessage => "This is an empty group"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.