/*---- header file for class: PlayerChar a PlayerChar represents a player in a game (for example, in a role-playing game) by: Sharon Tuttle last modified: 2022-09-21 - removing excess "intro to writing a class" comments 2022-09-20 - original version ----*/ #ifndef PLAYERCHAR_H #define PLAYERCHAR_H #include <string> using namespace std; // class definition for class PlayerChar class PlayerChar { public: // constructor methods PlayerChar(); PlayerChar(string init_name, int init_strength, double init_exp, string init_role, int init_hp); // accessor methods string get_name() const; int get_strength() const; double get_exp() const; string get_role() const; int get_hp() const; // mutator methods void set_name(string new_name); void set_role(string new_role); // have chosen NOT to allow the user // to directly change a PlayerChar // object's strength, exp, and hp // "other" methods /*--- signature: display_player: void -> void purpose: expects nothing, prints to the screen the characteristics of the calling player char, and returns nothing ---*/ void display_player() const; /*--- signature: player_to_string: void -> string purpose: expects nothing, and returns a string depiction of the calling player char ---*/ string player_to_string() const; private: // data fields string name; int strength; double exp; string role; int hp; }; #endif