Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrouind committed Jul 4, 2024
1 parent ce2f220 commit 5b6d6fc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion WLEditor/Overworld/PathForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ void DrawLine(List<Point> points, List<Color> colors)
var miterPoints = GetMitterPoints(zoom * 4.0f);

int n = 0;
foreach (var item in colors.GroupByAdjacent(x => x, (x, y) => new { Color = x, Count = y.Count() }))
foreach (var item in colors.GroupByAdjacent(x => x, (x, y) => (Color: x, Count: y.Count() )))
{
brush.Color = item.Color;
gPathA.FillPolygon(brush, GetLineStrip(n, item.Count + 1).ToArray(), FillMode.Winding);
Expand Down
2 changes: 1 addition & 1 deletion WLEditor/Rom/Overworld.cs
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ void SaveTreasurePositionPerLevel()

//group levels at same position (usually duplicates)
foreach (var levels in pathData
.Select((x, i) => new { Index = i, x.X, x.Y })
.Select((x, i) => (Index: i, x.X, x.Y))
.GroupBy(x => (x.X, x.Y)))
{
int index = 0xFF;
Expand Down
2 changes: 1 addition & 1 deletion WLEditor/Selection/Selection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public List<SelectionChange> PasteSelection(Func<int, int, int, int> setTileAt)
int selectionWidth = reader.ReadInt32();
int selectionHeight = reader.ReadInt32();
ClipboardData[] selectionData = Enumerable.Range(0, selectionWidth * selectionHeight)
.Select((x, i) => new { Order = reader.ReadInt32(), Tile = reader.ReadInt32(), Index = i })
.Select((x, i) => (Order: reader.ReadInt32(), Tile: reader.ReadInt32(), Index: i ))
.OrderBy(x => x.Order) //used for ordering events
.Select(x => new ClipboardData { Index = x.Index, Tile = x.Tile })
.ToArray();
Expand Down

0 comments on commit 5b6d6fc

Please sign in to comment.