ok nah that didnt work, ok aint much so post it all up, hope this helps :D
Player.cpp
#include "Player.h"void cPlayer::Move(cPlayer &Player, Map &zap) { int input; cout << "\n1) North\t2) South\t3) East\t4) West\t5) Cancel\n"; cin>>input; switch(input) { case 1: zap.North(1); break; case 2: zap.South(1); break; case 3: zap.East(1); break; case 4: zap.West(1); break; }//}}void cPlayer::ShowAll() { cout << "\n\n~~~~~~~~~~~~~~~~~~~~~~~\n~~~~~~~~~~~~~~~~~~~~~~~"; cout << "\nName is: " << name; cout << "\nRace is: " << race; cout << "\nHP is: " << hp; cout << "\nMP is: " << mp; cout << "\nWeapon is: " << pWeapon.gName(); cout << "\nMax Damage is: " << pWeapon.minDam(); cout << "\nMax Damage is: " << pWeapon.maxDam(); cout << "\n~~~~~~~~~~~~~~~~~~~~~~~\n~~~~~~~~~~~~~~~~~~~~~~~\n";}void cPlayer::Race() { int num; string temp; cout << "\nSelect Class: \n\t\t 1) Warrior\n\t\t 2) Wizard \n\t\t 3) Dwarf\n"; cin>>num; switch(num) { case 1: cout << "WARRIOR!"; temp = "Warrior"; mp = 20; hp = 100; pWeapon.Name("Long Sword"); pWeapon.minDam(2); pWeapon.maxDam(6); break; case 2: cout << "Wizard!"; temp = "Wizard"; mp = 60; hp = 50; pWeapon.Name("Staff"); pWeapon.minDam(2); pWeapon.maxDam(6); break; case 3: cout << "Dwarf!"; temp = "Dwarf"; mp = 40; hp = 65; pWeapon.Name("Pole"); pWeapon.minDam(2); pWeapon.maxDam(6); break; } race = temp;}
Map.h - no .cpp
#pragma once//#ifndef MAP_H//#define MAP_H//#include "Player.h"#include <iostream>#include <string>using namespace std;class Map {public: void North(int) { y += 1; } void South(int) { y -= 1; } void East(int) { x += 1; } void West(int) { x -= 1; } void Show(cPlayer lame) { cout << x << ", " << y; }private: int x; int y;};
weapon.h
#pragma once//#ifndef WEAPON_H//#define WEAPON_H#include <string>#include <iostream>using namespace std;class cWeapon {public: void Name(string temp) { name = temp; } string gName() { return name; } void minDam(int min) { mnDam = min; } int minDam() { return mnDam; } int maxDam() { return mxDam; } void maxDam(int max) { mxDam = max; } void Value(int t_value) { value = t_value; } int Value() { return value; }private: string name; int mnDam; int mxDam; int value;};//#endif
#pragma once//#ifndef PLAYER_H//#define PLAYER_H//#include "map.h"#include <string>#include <iostream>#include "map.h"#include "weapon.h"using namespace std;//class Map;class cPlayer {public: void Name(string &temp) { name = temp; } string GName() { return name; } void ShowAll(); int HP(); int MP(); void Move(cPlayer & player, Map & zap); string weapon(cWeapon &Name) { pWeapon = Name; } void Race();private: string name; string race; cWeapon pWeapon; int hp; int mp;};//#endif
#include "Player.h"#include "map.h"#include <string.h>#include <iostream>using namespace std;class cPlayer;class Map;int main() { cPlayer * Player = new cPlayer; Map * zap = new Map; string name; cout << "Welcome to a DCMK game\n"; cout << "Character Name: "; cin>>name; Player->Name(name); Player->Race(); Player->ShowAll(); Player->Move(*Player,*zap); cout << "\n"; return 0;};
theres actually not that much so thought bung it all in, but honestly - it's probably glaringly obvious - but doing my nut in - help!