ucsb-cs56-projects / cs56-misc-map-gui

-
0 stars 7 forks source link

Factor out the duplicate code #13

Open pconrad opened 11 years ago

pconrad commented 11 years ago

There SOOOOOO MUUUUUCHH DUUUPLICAAAATE COOOOODE. An obvious improvement is to factor out the "one per building methods" into a single "displayBuilding(String buildingCode)" method that would work off of a HashMap to get the correct information?

Similarly, it seems crazy to have a separate JLabel object reference for each building, rather than putting them into an ArrayList or HashMap, and then iterating through.

Try to get rid of everything that is iterating over building name---and replace it with appropriate data structures.

200 points

vincenicoara commented 8 years ago

Accepted