kunderwood1 / Dungeon-Refactor

Refactoring! Choose a team of 3 (preferred) or 2 (ok) for this assignment DungeonSource.zip The zip file above contains an assignment specification for the first version of the Heroes and Monsters assignment given way back in 2001. The zip also contains the instructor's source code for the solution to the assignment. It is your job to refactor that code to improve structure, readability, maintainability, and usability. Employ the Object Oriented concepts you have learned throughout the quarter to accomplish this task. Utilize patterns, code smell refactors, OO principles (e.g. 'favor composition over inheritance' or 'program to an interface, not an implementation). Any improvement you can make to the existing design is a refactor. Something as simple as changing visibility of a method or field suffices. Choosing better names is also legitimate. There are many ways to refactor the given code. There are a multitude of code smells. Futhermore, some of the code uses (arguably) outdated tools from the Java API. You are welcome to employ current tools that do the job better as you deem necessary. Include in your submission the following items in a zip file: Your refactored version of the code Single .pdf of the UML diagrams that represent your (improved) design A *detailed* document describing each refactor you performed and why -- YOU MUST NUMBER EACH ITEM YOU REFACTOR. Be sure and include the offending code as part of your description. Note that snippets of the offending code suffice. NOTE/QUESTION: How many refactors should you have? The closer to 8 you get, the closer you will be to full credit. More specifically, you should have at least 8 refactors. Note that it is okay to submit more than 8 to cover yourself if you are unsure something is a true refactor. NOTE 2: Renaming fields and methods collectively is a single refactor... HAVE FUN!
2 stars 2 forks source link

Implement strategy #2

Open kunderwood1 opened 4 years ago

kunderwood1 commented 4 years ago

code to interface not implementation

hewrtarkhany commented 4 years ago

we can use an interface to and create an abstract class DungeonCharacters make the fields private

    private String name;
private int hitPoints;
private int attackSpeed;
private double chanceToHit;
private int damageMin, damageMax;

then create getters and setters

kunderwood1 commented 4 years ago

@tarkhany are you wanting to take on this issue?

kunderwood1 commented 4 years ago

this is meant as an interface for Attack sorry fro the confusion.

hewrtarkhany commented 4 years ago

i got it