Closed Apanian25 closed 3 years ago
https://github.com/Apanian25/Comp345-Risk/blob/6f9c3a3f55028a8594d1b5386991090b00f6bd69/Risk/Comp345-Risk/MapLoader.h#L17 well I mean yes it does, but this is misleading. You don't use this method to set the map name, this does set the map name, but it is also good to mention it is a constructor although it may be obvious. in the header file | your comment in the cpp file is ok
https://github.com/Apanian25/Comp345-Risk/blob/6f9c3a3f55028a8594d1b5386991090b00f6bd69/Risk/Comp345-Risk/MapLoader.h#L30 you overwrote the wrong operator, the stream insertion
operator is <<
, you were using the stream extraction(>>)
operator
https://github.com/Apanian25/Comp345-Risk/blob/6f9c3a3f55028a8594d1b5386991090b00f6bd69/Risk/Comp345-Risk/MapLoader.cpp#L35 This is the right implementation, just the method header is wrong
https://github.com/Apanian25/Comp345-Risk/blob/6f9c3a3f55028a8594d1b5386991090b00f6bd69/Risk/Comp345-Risk/MapLoader.cpp#L48 Not sure what you are doing here, I'm pretty sure you are supposed to do something along the lines of this->map = map;
. Also you forgot to assign the map name in your copy constructor
https://github.com/Apanian25/Comp345-Risk/blob/6f9c3a3f55028a8594d1b5386991090b00f6bd69/Risk/Comp345-Risk/MapLoader.cpp#L68 Remove this, it has no significance here
https://github.com/Apanian25/Comp345-Risk/blob/6f9c3a3f55028a8594d1b5386991090b00f6bd69/Risk/Comp345-Risk/MapLoader.cpp#L155 I like this comment, add it to the other places where you are using a string list, very good!
Tasks
[x] Map loader can read any Domination map file.
[x] Map loader creates a map object as a graph data structure (see Part 1).
[x] Map loader should be able to read any text file (even invalid ones).
[x] Driver reads many different map files, creates a graph object for the valid ones and rejects the invalid ones.
Description
Implement a group of C++ classes that reads and loads a map file in the .map text file format as found in the “Domination” game source files, available at: http://domination.sourceforge.net/getmaps.shtml, The map loader must be able to read any map file available on the above web page. The map loader should store the map as a graph data structure (see Part 1). The map loader should be able to read any text file (even ones that do not constitute a valid map). All the classes/functions that you implement for this component must all reside in a single .cpp/.h file duo named MapLoader.cpp/MapLoader.h. You must deliver a file named MapLoaderDriver.cpp file that contains a main function that reads various files and successfully creates a map object for valid map files, and rejects invalid map files of different kinds.