Some code to help you with WA-TOR
I have created the following demonstration to help you with problems you might have in the Wa-tor code.
You may look at as little or as much of this code as you want.
You may use this code in your final solution if you wish.
I put this code together quickly, so there may be errors, and flaws in the design, but it is a starting point.
Some specific notes
- The 2d array class is a template, it is sort of what I expected from you.
- The coordinate is actually a structure with supporting methods.
- I really would turn this into a class and clean up the code in the client classes.
- But this is just a demo.
- In Map class
- I needed a reference to PlayerT, but I did not want to include it, so I build a forward class reference
-
class PlayerT;
- This will work as long as
- I only declare pointers to the PlayerT
- I do not use any functions associated with the PlayerT in the header file..
- I can inlude PlayerT.h in the implementation file.
- This avoids any circular references in the .h files.
- Nothing else is truely noteworthy.