Constructors
Brought to you by:
alecsloman
Instead of using a set method for combatant and subclasses, we should write constructors. I think there is a chapter on
overloading constructors, which will be essential for us because we want to have orcs and humans of different types without creating many subclasses. If we could use just constructors to create our different types, it would be cool. But there is a limitation. C++ only allows constructors to be called one thing. They are differentiated by their argument lists. The sort of constructors we want shouldn't take arguments, since they just initialize the members to a cookie-cutter set of data like as in the setChieftain method. See what I mean? This is a problem we're going to have to solve.
You can't overload constructors in the way that I was hoping ... you can only do it by having different argument lists. So that's not what we really want. I settled on just putting a switch in each constructor, so when you initialize an object, you have to type in the command line what template to initialize it from. Think of some other ways.