For our final assignment we are going to simulate the gladiatorial contests in the Colosseum in Rome. The game will begin with you reading a json file that contains a list of competitors. Each competitor will compete in the arena in a tournament style battle until there is only one left. An audience will boo, cheer, and ultimately decide the fate of each contender.
Gladiator
The gladiator data will consists of name (string), age (int), birthplace (string), and health (int 0-100). The data will be stored in a json file in the following format: [ {name: ceasar, age: 56, birthplace: Rome, health: 50} ... ] The outcome of the gladiatorial tests should be based on an algorithm of your choosing with 2 requirements:
Audience
Next you will need to create an audience. The audience class observes the Gladiators as they go through the gladiatorial games, giving cheers, boos, or gasps as events occur in each match. You should create an audience of at least 100 audience objects that register as observers of the gladiator. The gladiator then notifies the audience whenever an event occurs. There are 3 possible event types:
Response
In addition to the audience class, you should create at least 3 audience member response strategies which will determine how different audience members respond to an event. For example, a negative response type would produce the following results:
Another response type, for example positive:
The response strategies should be contained in their own classes and should be assigned randomly to each audience object.
Each audience member randomly chooses one of the gladiators during the match to observe and respond to. The response strategy for each audience member should be updated with a new response strategy for each match.
Once you have your gladiators and your audience set up, the gladiatorial tournament can begin.
Arena
The Arena class will hold all the audience members, gladiators, and battle logic.
Your gladiators will be put into the arena and compete in battle. Your logic will be to retrieve the next two gladiators from the pool of gladiators and have them battle until one reaches zero health. Then the audience will decide if the loser should have another chance with a thumbs up or thumbs down vote.
Each audience member will choose thumbs up or thumbs down based on any algorithm of your choosing.
In this assignment, you will use the Strategy and Observer Patterns. How each pattern will be used is explained below.