private bool TakesAColumnPlace(Wall newWall)
        {
            bool existColumnInWallPlace = false;

            foreach (ISinglePointComponent column in materials.GetColumns())
            {
                if (newWall.DoesContainComponent(column) || column.GetPosition().Equals(newWall.End()) || column.GetPosition().Equals(newWall.Beginning()))
                {
                    existColumnInWallPlace = true;
                }
            }
            return(existColumnInWallPlace);
        }
Ejemplo n.º 2
0
        private bool FitsInItsWall(Opening newOpening)
        {
            Wall itsWall = materials.GetWalls().FirstOrDefault(w => w.DoesContainComponent(newOpening));
            Wall pieceThatWouldOccupy = PieceOfOccupiedWall(newOpening, itsWall);

            bool fits = false;

            if (!OutOfWallBorder(pieceThatWouldOccupy, itsWall))
            {
                ICollection <Opening> thatWallsOpenings = materials.GetOpenings().Where(o => itsWall.DoesContainComponent(o)).ToList();
                fits = !thatWallsOpenings.Any(o => PieceOfOccupiedWall(o, itsWall).Overlaps(pieceThatWouldOccupy));
            }
            return(fits);
        }
Ejemplo n.º 3
0
 private IEnumerable <Opening> GetOpeningsFromWall(Wall aWall)
 {
     return(materials.GetOpenings().Where(opening => aWall.DoesContainComponent(opening)));
 }