I'm working on a project now and I am confused on how to approach this.
class Unit: public Entity { string Name; int HP; int MP; int Agi; int Spr; int Def; int Atk; int Lvl; int Exp; std::vector<int> states; string unitType; public: int GetHP() {return HP}; int GetMP() {return MP}; int GetAgi() {return Agi}; int GetSpr() {return Spr}; int GetDef() {return Def}; int GetAtk() {return Atk}; int GetLvl() {return Lvl}; int GetExp() {return Exp}; std::vector<int>& GetStates() {return &states}; string GetUnitType() {return unitType}; virtual void SetHP(int newValue); virtual void SetMP(int newValue); virtual void SetAgi(int newValue); virtual void SetSpr(int newValue); virtual void SetDef(int newValue); virtual void SetAtk(int newValue); virtual void SetLvl(int newValue); virtual void SetExp(int newValue); I need to return a reference to "std::vector states" so that I can iterate through it and look for values. I believe I should be using a Set because I only have one value and there cannot be repeats, but I'll save that for later. Is the "std::vector& GetStates() {return &states}" correct? Should it be changed to "std::vector& const GetStates() {return &states}" or am I completely off? I saw a post on here similar to this but it didn't specifically answer my question as they weren't using it in the same pretense as this.