How to do it? If i pass an object as an argument thru a function of another object like so
class Player
{
public:
Player(int hp = 100, int xp = 0, int atk = 17);
int getHP() const;
int getXP() const;
int getATK() const;
bool attack(Mob& mob);
private:
int m_HP;
int m_XP;
int m_ATK;
};
.. the Mob class definition must come before the Player class definition... However in my Mob class definition i have an argument regarding the Player object...
class Mob
{
public:
Mob(int hp = 50, string name = "Giant Roach", int attack = 9); //defaults
int getHP() const;
string getName() const;
int getAttack() const;
bool dmg(int& dmg);
int attack(Player& player);
private:
int m_HP;
string m_Name;
int m_Attack;
};
how do i get them both to interact if i have to define one before i can use it in the other??