コード例 #1
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);
        }
コード例 #2
0
 public override ICollection <Opening> GetOpenings()
 {
     return((ICollection <Opening>)materials.GetOpenings());
 }