Good day all. I am trying to write a c++ rpg game, learning c++ as I go. As I understand it, the example below is a basic class, and I can access my variables with dot notation. Along with the class functions or methods if you wish. Thats all fine and good. I have the "stats" for over 250 monsters now, and will probably have around 325 by the time I'm finished. So I need to set this class up to handle that many monsters, each having their very own stats. Could someone please explain how this is done? Maybe a small example to help me get it started? Tips, pointers? I have watched some videos on "C++ tutorials" on youtube. They set up a class, and access it through main directly... I doubt this is how it is done in the real world of programming. In the real world, I would imagine you can access the class through other functions, that are called from main. So another question would be after you make an instance of your class in main, can you have other functions access it? Please pardon my swiss cheese education in C++. I would appreciate any wisdom. Thank you.
class monsters
{
public:
string mnam; // name
int level; // level
int ac; // monsters armor class rating if any
int gender; // monsters gender
int min; // minimum it will hit for
int max; // max it will hit for
int gold; // gold monster has
int hits; // hit points
int mexp; // experience reward
int weap; // weapon monster has if any
string mdesc; //description
private:
void monattack(){} // routine monster attacks you
void monrun(){}// moster can run if hurt bad enough
void monfol(){}// monster may follow if you run
void mondeal(){} // monster makes deal for it's life when hurt badly
void mondies(){} // awards gold and experience
};