1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
#include <iostream>
using namespace std;
enum ActorType { PC, NPC };
class Player
{
public:
void set_Stats(string a, int b, int c) { Name = a; HP = b; HPM = c; }
string get_Name() const { return Name; }
int get_HP() const { return HP; }
int get_HPM() const { return HPM; }
private:
string Name;
int HP;
int HPM;
};
void SomeFunc(string Name, int HP, int HPM);
int main()
{
Player ACT[2][2];
ACT[PC] [0].set_Stats("Guy" , 24, 24);
ACT[PC] [1].set_Stats("Kid" , 20, 20);
ACT[NPC][0].set_Stats("Goblin" , 12, 12);
ACT[NPC][1].set_Stats("MrFiddler", 35, 35);
/// There must be a better way to do this!
SomeFunc(ACT[PC][0].get_Name(), ACT[PC][0].get_HP(), ACT[PC][0].get_HPM());
}
void SomeFunc(string Name, int HP, int HPM)
{
// Stuff..
}
|