Question: Has anyone done this before? Modify your BattleManager class Add a method called battle. This method takes, as parameters, 2 heroes and a number of

Has anyone done this before? Modify your BattleManager class Add a method called battle. This method takes, as parameters, 2 heroes and a number of rounds to fight. Your battle method should use a loop to run the round methods, with the heroes as input to round. Battle should return the hero with the most health after all rounds have completed. You can handle a tie how ever you like AS LONG AS A HERO OBJECT YOU CONSIDER THE WINNER IS RETURNED Add a method called tournament. This method takes, as parameters, an array of heroes. This method runs a single elimination tournament on all the heroes. The method should call the battle method for pairs of heroes in the array. Each battle in the tournament lasts for 3 rounds. After the tournament has completed, return the hero object that is the winner of the entire tournament Test your changes to the battle manager by creating a main class that Creates a battle manager Creates 2 heroes and battle them for 5 rounds. using the battle method. Creates an array of 5 hero objects call the tournament method with your array

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!