I'm trying to write a Class that defines the stats from a champion/character and I want to initialize "champions" with name, id, hp, ... in the Class My question is how do I do that? Do I need another class or do I define objects in the class which I did ?
#include <iostream>
using namespace std;
class ChampionStats {
private:
int m_id;
string m_name; // champion ID and Stats
int m_hp;
int m_ad;
public:
ChampionStats(int id, string name, int hp, int ad) {
m_id = id;
m_name = name; // initialize Champion
m_hp = hp;
m_ad = ad;
}
void printChamp() { // print champion stats
cout << "ID: " << m_id << endl
<< "Name: " << m_name << endl
<< "HP: " << m_hp << endl
<< "AD: " << m_ad << endl;
}
};
int main() {
return 0;
}