Exemple #1
0
        public PossiblePropPositions arrayFill(Point point, List <Point> points, IProp prop, Point direction, Room room)
        {
            var maxCount = prop.MaximumClusterCount();
            var maxArea  = 20;
            var possiblePropPositions = new List <Point>();
            var propArea    = prop.Width() * prop.Height();
            var currentArea = 0;

            while (currentArea < maxArea && possiblePropPositions.Count < maxCount)
            {
                if (checkIfPropFits(point, points, prop, room))
                {
                    possiblePropPositions.Add(point);
                    point        = new Point(point.X + direction.X * prop.Width(), point.Y + direction.Y * prop.Height());
                    currentArea += propArea;
                }
                else
                {
                    break;
                }
            }
            return(new PossiblePropPositions(prop, possiblePropPositions));
        }