i've tried using a list and hashmap but i really have no idea
some help please... many thanks
i came from a c++ background
Joined: Apr 21, 2005
OK, since this is 8% of your final grade I have deliberately been a little vague...
[EDIT: I just read further down and saw the large amount of code you have been given so far. I'm leaving my original post in tact but of course you should conform with all the requirements stated (e.g. the IShape interface) or you will have problems later.]
To start with I would create a class called Shape to represent the shape data. Fields should include shapetype, colour, x, y, etc (note NOT the shape ID). You will need to make two constructors for this class since regular shapes have 6 properties, and line shapes have 7. When you have done this you should be able to write some code like:
Instead of hard coding the colour and values like I have you will read them from the file.
When you have created the shape instance, add them to a HashMap like so:
Again, instead of hard-coding the "t2_1" you will read it from the file.
Hope this helps a little.
[ April 21, 2005: Message edited by: S Gray ] [ April 21, 2005: Message edited by: S Gray ]