Beispiel #1
0
 public Table(String fancyName, Room room, Material material, Size size, double price, int numberOfChairs, bool scratchResistant, bool compactSize)
     : base(fancyName, room, material, size, price)
 {
     this.numberOfChairs = numberOfChairs;
     this.scratchResistant = scratchResistant;
     this.compactSize = compactSize;
 }
 public AbstractFurniture(String fancyName, Room room, Material material, Size size, double price)
 {
     this.fancyName = fancyName;
     this.room = room;
     this.material = material;
     this.size = size;
     this.price = price;
 }
Beispiel #3
0
 public Wardrobe(String fancyName, Room room, Material material, Size size, double price, int numberOfShelves, DoorType typeOfDoor, bool mirror,
         bool builtInLamp)
     : base(fancyName, room, material, size, price)
 {
     this.numberOfShelves = numberOfShelves;
     this.typeOfDoor = typeOfDoor;
     this.mirror = mirror;
     this.builtInLamp = builtInLamp;
 }
Beispiel #4
0
 public Bed(String fancyName, Room room, Material material, Size size, double price, Mattress mattress, bool doubleSize, bool compactSize,
         bool builtInLamp)
     : base(fancyName, room, material, size, price)
 {
     this.mattress = mattress;
     this.doubleSize = doubleSize;
     this.compactSize = compactSize;
     this.builtInLamp = builtInLamp;
 }
Beispiel #5
0
 public bool Equals(Size that)
 {
     if ((object)that == null)
     {
         return false;
     }
     if (that.width == this.width && that.height == this.height && that.length == this.length)
     {
         return true;
     }
     return false;
 }
Beispiel #6
0
 private static void testSize()
 {
     Console.WriteLine("# testSize()");
     Size size = new Size(120.4323, 100.3543, 45);
     Console.WriteLine(size);
     size = Size.fromString("120.4323", "100.3543", "45");
     Console.WriteLine(size);
 }
Beispiel #7
0
        private static void testEqualsSize()
        {
            Console.WriteLine("\n# testEqualsSize()");
            Size one = new Size(100, 30, 60);
            Size two = new Size(100, 30, 60);
            Size three = new Size(100, 30, 60);

            Size four = new Size(101, 30, 60);
            Size five = new Size(100, 31, 60);

            Debug.Assert(!one.Equals(null), "error (implementation bug)");
            Debug.Assert(!one.Equals(new Random()), "error (implementation bug)");

            Debug.Assert(one.Equals(two), "error (implementation bug)");
            Debug.Assert(two.Equals(one), "error (implementation bug)");
            Debug.Assert(two.Equals(three), "error (implementation bug)");
            Debug.Assert(one.Equals(three), "error (implementation bug)");

            Debug.Assert(one.Equals(four) == four.Equals(one), "error (implementation bug)");

            Debug.Assert(!one.Equals(four), "error (implementation bug)");
            Debug.Assert(!one.Equals(five), "error (implementation bug)");
            Debug.Assert(!two.Equals(four), "error (implementation bug)");
            Debug.Assert(!three.Equals(five), "error (implementation bug)");

            Debug.Assert(one == two, "error (implementation bug)");
            Debug.Assert(two == one, "error (implementation bug)");
            Debug.Assert(one != four, "error (implementation bug)");
            Debug.Assert(four != one, "error (implementation bug)");
        }
Beispiel #8
0
 public void addWardrobe(String fancyName, Room room, Material material, Size size, double price, int numberOfShelves, DoorType typeOfDoor, bool mirror,
         bool builtInLamp, int count)
 {
     this.addFurniture(new Wardrobe(fancyName, room, material, size, price, numberOfShelves, typeOfDoor, mirror, builtInLamp), count);
 }
Beispiel #9
0
 public void addTable(String fancyName, Room room, Material material, Size size, double price, int numberOfChairs, bool scratchResistant,
         bool compactSize, int count)
 {
     this.addFurniture(new Table(fancyName, room, material, size, price, numberOfChairs, scratchResistant, compactSize), count);
 }
Beispiel #10
0
 public void addBed(String fancyName, Room room, Material material, Size size, double price, Mattress mattress, bool doubleSize, bool compactSize,
         bool builtInLamp, int count)
 {
     this.addFurniture(new Bed(fancyName, room, material, size, price, mattress, doubleSize, compactSize, builtInLamp), count);
 }