Repo-wide sweep with the pinned CSharpier 1.3.0 tool. Whitespace and line-wrapping only; OpenNest.Engine.Tests (109) and OpenNest.IO.Tests pass after reformat, full solution builds 0 errors. Added .csharpierignore so csproj/config XML keeps its existing layout (CSharpier's XML wrapping churns attributes with zero benefit). Formatting is now enforceable: dotnet csharpier check . passes.
32 lines
626 B
C#
32 lines
626 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using OpenNest.Geometry;
|
|
|
|
namespace OpenNest.RectanglePacking
|
|
{
|
|
internal class Bin : Box
|
|
{
|
|
public Bin()
|
|
{
|
|
Items = new List<Item>();
|
|
}
|
|
|
|
public List<Item> Items { get; set; }
|
|
|
|
public double Density()
|
|
{
|
|
return Items.Sum(i => i.Area()) / Area();
|
|
}
|
|
|
|
public object Clone()
|
|
{
|
|
return new Bin
|
|
{
|
|
Location = this.Location,
|
|
Size = this.Size,
|
|
Items = new List<Item>(Items),
|
|
};
|
|
}
|
|
}
|
|
}
|