Im trying to make a somewhat simple RPG. I am wondering if the functions that affect my Class Player should be type Player, type void or some other type. Should i be using pointers or making my functions type Player.
class Player
{
Public:
Player levelUp(Player a); //The function declaration
Private:
int Hp;
int Att;
int Def;
int Speed;
}
Player Player::levelUp(Player a) //The function definition
{
a.Hp =+ 3;
a.Att =+ 2;
a.Def =+ 2;
a.Speed =+ 2;
return a;
}
Is this how i should be using functions that affect my Player class or should i be using pointers/references?