private static void testAbstractFurniture() { Console.WriteLine("\n# testAbstractFurniture()"); AbstractFurniture table = new Table("Tango", Room.Kitchen, Material.Oak, new Size(80, 90, 100), 120, 4, false, true); Console.WriteLine(table); AbstractFurniture wardrobe = new Wardrobe("John", Room.Bedroom, Material.CherryTree, new Size(50, 160, 90), 180, 3, DoorType.Sliding, true, false); Console.WriteLine(wardrobe); AbstractFurniture bed = new Bed("Foxtrot", Room.LivingRoom, Material.Pine, new Size(100, 45, 210), 230, Mattress.Healthy, false, true, false); Console.WriteLine(bed); Program.sellFurniture(table, 1); Program.sellFurniture(wardrobe, 2); Program.sellFurniture(bed, 1); }
public bool Equals(Table that) { if ((object)that == null) { return false; } if (base.Equals(that)) { if (that.numberOfChairs == this.numberOfChairs && that.scratchResistant == this.scratchResistant && that.compactSize == this.compactSize) { return true; } } return false; }