.. (לתיקייה המכילה) | ||
Clarification on interface change and exception handling | |
Has been added to the homework document at version 1.6 (please see updated version). Rules are as follows 1. string type replaces char* in all interfaces. char* is not to be used in the exercise 2. Game Interface functions from previous assignment are *not to throw*, not even IllegalWeapon (need to add a corresponding ILLEGAL_WEAPON GameStatus value) 3. New interface functions, fight method are to throw, according to rules described |
Objects of type Player, addPlayer | |
In this assignment, creating objects of type Player should be disallowed. Possible ways to accomplish this are either rendering Player abstract by adding a pure virtual method, or making its constructor non-public (both ways are fine). Method Game::addPlayer should add a Warrior with rider=false, which is arguably the closest to Player from previous exercise. This has also been added as a clarification to the homework document, at version 1.6 |
Usage of namespace mtm, mtm::array or ::Array? | |
Usage of namespace mtm was removed from the exercise. Template Array class in mtm_array.h should be called just Array, not be in any namespace (i.e. ::Array / global namespace). In general, in this exercise, none of your code should be in a namespace (at least, from an outside user's point of view), except the exceptions in mtm_exceptions.h, which you need to use as provided (without modification). It is not to be submitted. |
An update on the rules of fight | |
A slight simplification was issued, whereby range rules (wizard can attack up to a range, never in the same position, others without change) are _in addition_ to weapon strength rule from previous exercise. i.e. a wizard can only attack players with weaker weapons (just as in previous exercise). Vice versa, Warrior and Troll can only attack a Wizard with a weaker weapon, even if they are at the same position. |
Clarification on usage of Array in part C | |
As some of you correctly noticed, class Array from part B cannot be used as is since array size needs to be known at compile time. This means that you need to use another container - either from STL, or implement your own, which can set its size at run time (e.g. accepts size parameter to the constructor). One way to the latter would be to create a DynamicArray class containing much of the array implementation in part B (including iterators), then inherit Array from it (adding/modifying whatever is needed). Another way which will be accepted (although leads to significant code duplication) is creating a separate, unrelated DynamicArray class for part C. |
Error due to Looser Throw Specifier in virtual destructor default override | |
Arises due to language standard underspecification. To get code compiling, need to explicitly let compiler know overriding destructor does not throw, like this: virtual ~Child() throw() override = default; |