Game

Take on the task of developing the Game class in this challenge.

Upon completion of the Team class, our focus shifts to developing the Game class.

Press + to interact
UML diagram highlighting the development focus on the game class
UML diagram highlighting the development focus on the game class

As illustrated in the UML diagram, the Game class comprises two classes, Team and PlayerGameStats. Therefore, to construct the Game class, we require both of these components. While the Team class is already prepared, the PlayerGameStats class still awaits development.

Two feasible options present themselves:

  • One, to commence by constructing the PlayerGameStats class before proceeding to the Game class.

  • Two, to proceed with building the Game class without the PlayerGameStats class for the time being.

In our case, we opt for the latter approach. We’ll initially develop the Game class without the PlayerGameStats class. Subsequently, once the Game class is constructed, we’ll proceed to develop the PlayerGameStats class and then update the Game class accordingly.

Because every game entails the participation of two teams, the Game class includes two data members of type Team to meet this requirement.

public Team homeTeam;
public Team awayTeam;

Another noticeable alteration emerges within the ...

Get hands-on with 1400+ tech skills courses.