$24
Goals
To build Game, a shell class that eventually will become a Can’t Stop game.
To write a program with four interacting classes, a main module, and the tools. To de ne a function that delegates part of its action to another class.
The Game Class
Eventually the Game class will be the primary class of the Can’t Stop application. Initially, it is mostly an empty shell to which parts will be added each week.
2.1 Instructions
Members for this week:
A private Dice* that points at a set of 4 dice. Later this will be replaced by polymorphic dice.
Two Players, with di erent names and colors input from the keyboard. Later, this will be replaced by a circular linked list of 2 to 4 players.
Two Columns with di erent lengths. Later, this will be replaced by a Board that has an array of eleven columns.
A Game constructor with no parameters. When construction is nished, your players, dice, and columns should be initialized .
An appropriate Game destructor. Do you need to call delete or delete[]?
A getNewPlayer() function that will input a player’s data from the keyboard and call the Player constructor.
Testing
Do enough testing to test the interaction between Game and the three classes Dice, Player, Column.
You know the Game constructor can construct the right kind of dice and that they can be rolled and printed.
Make sure you can input data for and construct two Players, and that the second Player has a di erent name and color from the rst.
Call all the functions that you have de ned so far.
There is very little other testing to do because most of the testing work is done in the unit tests for the other classes.