Question: In OOP we model our problems using objects that we can manipulate. To create and use objects, we need to write classes. Classes are a

In OOP we model our problems using objects that we can manipulate. To create and use objects, we need to write classes. Classes are a sort of a blueprint that describes the properties and behaviour of the objects we want to create. In this assignment we are going write classes representing Characters for RPG games similar to World of Warcraft and others. Our game will have different kinds of Characters and Attacks. We will use Inheritance to reduce duplicated code, allow for easy expansion of the game's base carachters (and attakcs), and explore polymorphic behaviour. In a real-world scenario we would also be leveraging the concepts of Interfaces to write the code. We will see interfaces in the near future; however, because we are a little behind in the schedule we will not have interfaces on this assignment. After you finish this assignment, try to answer the following questions: How diffictulry it would be to add a new type of character to the game? What code do you need to change to add the new character? How difficult would it be to implement our game without using inheritance? The starter code in Mimir comes with three packages: Attacks, Characters, and Game.

- Attacks: Contain the classes related to attacks in the game. These classes implementation is provided. Study them before starting the assignment. You don't have to edit the code inside this package. - Characters: Contain the classes related to our game characters. We will have initially three concrete Characters: Mage, Priest, and Warrior - Game: This package has an example code on how to use the Charcaters and Attacks to write a small turn-based duel of two game characters. You don't have to edit this code. You can run it once you have done the assignment. You can also study it to understand a bit more of the idea of using abstract types and polymorphism.

In OOP we model our problems using objects that we can manipulate.

Java please, please just do the "Attack" and all related diagram parts.

The Assignments Classes and Inheritance Diagram Attack - cost: int - name : String - damage: int - range: int + Attack(int, String, int, int) +getCosto: int + getDamage(): int + getRange(): int + getName(): int + interactWith Target(RPGCharaceter, int) : int + toString(): String Spell Melee Attack + Spell(int, String, int, int) + interact with Target(RPGCharaceter, int): int + Melee Attack(int, String, int, int) + interactWith Target(RPGCharaceter, int) : int Healing Spell Damage Spell + HealingSpellint, String, int, int) + interactWith Target(RPGCharaceter, int): int + toString(): String + DamageSpell(int, String, int, int) + interactWith Target(RPGCharaceter, int): int Ressurection + Ressurection + interactWith Target(RPGCharaceter, int): int + toString(): String

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!