Print at Dec 26, 2025, 9:30:54 PM

Posted by alied at Apr 4, 2011, 3:04:57 AM
Re: Add furniture progamatically !!!
typing from memory:
Home myHome = new Home();
HomePieceofFurniture hpf = new HomePieceofFurniture(somePieceOfFurniture);
myHome.addFurniture(hpf);

The point is, you need a instance of a class implementing PieceOfFurniture e.g. CatalogPieceOFFurniture, which you can get from a FurnitureCatalog. Then, add it to your Home object. easy if you see it.

Good luck.
As I said, I'm typing from memory, so actual names of functions may differ.