Re: Add furniture progamatically !!!
by alied » Mon Apr 04, 2011 3:04 am
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.