Multithreading Java – Football Game Simulation
Project detail
The project consists in simulating a football game using thread.
All the requirements:
1. Game starts (project is run) and 22 threads which represent 11 players from first team and 11 from second team start. Additionally to them we have two thread for 2 coaches and one thread for referee.
2. The time counter starts ( ex. 1 sec = 1 minute in game, it should be the possibility to choose the time) and the game is going on until the 45 minute, then the 15 minute pause happens and after starts the second half which continues until 90 minute and the game ends.
3. During the game you press a button and the timer stops allowing you to make a substitution of a player from the pitch to one from the bench( ex. player id 7 replaced with player id 13 from bench). That means that you also have 10 additional threads on sleep on the bench when the game starts(5 for each team). The substitution consists in activating the thread from the bench and killing the one from the pitch.
4. Both teams ( threads) are stored in lists, substitution being made using threads id.
5. At each end of the half are added some random additional minutes(ex. +1 minute to the first 45).
6. Only 5 substitution are allowed during the game and you can’t subsitute a player from one team with the player from the bench of another team.