Tournament
Complete this project with the construction of the Tournament class and integrate all other classes with it.
We’ve reached the final stage of our project. Up to this point, we’ve constructed the foundational classes needed for our project, but the core component that ties everything together—the Tournament
class—is yet to be implemented.
Previously, we discussed the PlayerGameStats
class, which encapsulates individual player statistics within a game. Now, we're shifting our focus to the Tournament
class, where we can integrate all prior classes and build the tournament’s structure. The Tournament
class will hold various essential elements, such as a list of teams and games, and will be responsible for determining the tournament winner, highest scorer, and the Most Valuable Player (MVP).
The Main
class acts as the client and central controller, facilitating the construction and testing of our project. As the Tournament
class will manage the list of games, we no longer need this list in the Main
class. Instead, the Main
class will delegate game management to the Tournament
class. Therefore, the project structure becomes more modular and easier to maintain.
Let’s examine the primary elements of the Tournament
class.
Data members
name
: The name of the tournament.season
: Represents the tournament’s season, typically the year it takes place.teams
: A list of teams participating in the tournament.games
: A list of games played during the tournament.mvp
: The MVP of the tournament.
Member functions
highest_scorer
...