Beispiel #1
0
 private static bool HouseIsValid(Floor floor, Walls walls, Roof roof)
 {
     return((floor != null && walls != null && roof != null) ||
            (floor != null && walls != null && roof == null) ||
            (floor != null && walls == null && roof == null) ||
            (floor == null && walls == null && roof == null));
 }
        public void BuildRoof()
        {
            Roof roof = new Roof();

            roof.SetHeight(100);

            this.shop.SetRoof(roof);
        }
Beispiel #3
0
        public House(string houseAddress, Floor floor, Walls walls, Roof roof)
        {
            if (!HouseIsValid(floor, walls, roof))
            {
                throw new ArgumentException("House is not valid!");
            }

            this.houseAddress = houseAddress;
            this.floor        = floor;
            this.walls        = walls;
            this.roof         = roof;
        }