Specifically, you will still work with the
classes Card, CardSet,
and Player, which will contain the same data members as
before.
You will add a Wargame class, which contains
a CardSet object called deck and
two Player objects, p1
and p2. It also contains a public
method, play() in which most of the program logic is
contained.
The substantial work of this assignment is in adding appropriate
methods to the Card, CardSet,
and Player classes. Each of the functions you wrote in
Assignment #3 should find a new identity as a class member; you may
need to give a little thought to which class each function
belongs to. In addition, you should provide at least a default
constructor for each class and possibly additional parameterized
constructors (some of the Assignment 3 functions may become
constructors!); also consider whether any of your classes needs a
destructor.
Once again, you do not have to implement the actual war function. You may decide which player wins the war arbitrarily (i.e. either by generating a random number or by giving the cards to the player with fewer cards).