Exemplo n.º 1
0
        /// <summary>
        /// Fill the grill with best fit meat.
        /// </summary>
        public virtual void FillCurrentRound()
        {
            Meat meat;

            do
            {
                var area = _maxRectangle.GetLargestRectangle(CurrentRound.Surface);
                meat = _strategy.GetNextMeat(_meats, area.Length, area.Width, out bool rotate);
                if (meat != null)
                {
                    CurrentRound.AddMeat(meat, rotate, area.LengthPosition, area.WidthPosition);
                }
            } while (meat != null);
        }
        public void MaxSurface()
        {
            var round = GetNewGrillRound();
            var area  = _maxRectangle.GetLargestRectangle(round.Surface);

            Assert.AreEqual(GrillLength, area.Length);
            Assert.AreEqual(GrillWidth, area.Width);
            Assert.AreEqual(0, area.LengthPosition);
            Assert.AreEqual(0, area.WidthPosition);
        }