Example #1
0
        public GrillAreaEnumerator(Grill grill, Size grillItemSize)
        {
            this.grillArea     = new Rectangle(Point.Empty, grill.Size);
            this.grillItemArea = new Rectangle(Point.Empty, grillItemSize);
            this.boxSize       = grill.BoxSize;

            if (!this.grillArea.Contains(grillItemArea))
            {
                throw new ArgumentOutOfRangeException(nameof(grillItemSize), "The Grill cannot contain this Grill Item because Grill Item is oversized inside the Grill.");
            }
            this.grillItemArea.Offset(-this.boxSize, 0);
        }
Example #2
0
 /// <summary>The constructor for GrillAreaEnumerable class.</summary>
 /// <param name="grill">The Grill object.</param>
 /// <param name="grillItemSize">The Size of the item.</param>
 public GrillAreaEnumerable(Grill grill, Size grillItemSize)
 {
     this.grill         = grill;
     this.grillItemSize = grillItemSize;
 }