Question: use java Review the object relationship diagram below, open the Game.txt file and map each row to the appropriate concrete class in the picture. Rectangle


use java
Review the object relationship diagram below, open the Game.txt file and map each row to the appropriate concrete class in the picture. Rectangle IDrawable GameObject enuWeapon Weapon Game Character Wizard ShopOwner INPC Part II: Class Key (You should also create your interfaces, enumerations, and classes in this order) Don't forget to put section breaks in your classes and format . 1. Interfaces IDrawable: contains a void draw(Graphics g) method INPC: contains a void randomlyMove() method 2. Advanced Enumerations enuWeapon: enum that stores the following fields: friendlyName, minDamage, maxDamage, weight i. Enum properties: hammer, sword, dagger, and crossbow ii. For up to 5 points of extra credit create a method called use() that returns a random int that represents the amount of damage the weapon caused based on the min and max damage property. You should also account for a miss (so you would return a 0). You should use the Random() class for this. . 3. Classes: All classes (when appropriate) will have all of the following or the parent of a class will have them Properties i. private with public getters / setters Constructors i. Workhorse ii. Copy iii. String iv. String[] Methods i. clone() ii. equals() iii. toString() that returns a nicely formatted string . a. GameObject: (abstract) derived from a Rectangle and is of type IDrawable Every game object is placed at a column and row position of a board so your text file will contain fields column and row. Create the common fields. Rows and Columns must have values 0 to 99 . b. GameCharacter: (abstract) properties: name (String), age (int) (age must range from 5 to 200) c. Weapon: derived from GameObject with property weapon Type (enuWeapon) d. Wizard: derived from GameCharacter e. ShopOwner: derived from GameCharacter and is of type INPC Part II: Tester 1. Create a tester that loads your text file and stores them in an ArrayList 2. Create a method that prints the number of Wizards 3. Create a method that prints the number of Daggers that are owned
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
