cPlayer.h is this
Code:
#ifndef CPLAYER_H
#define CPLAYER_H
#include "definitions.h"
class cPlayer
{
public:
cPlayer(void);
void SetValue(int SkillOrSpellID, int Value); //Sets the current value
int GetValue(int SkillOrSpellID); //Returns the current value
private:
int SkillAndSpellValues[NUMBER_OF_SKILLS_AND_SPELLS];
};
#endif
and my cPlayer.cpp looks like this
Code:
#include "cPlayer.h"
cPlayer::cPlayer(void)
{
int X;
for(X = 0; X < NUMBER_OF_SKILLS_AND_SPELLS; X++)
{
SkillAndSpellValues[X] = 0;
}
//Now all our values have been initialized to 0
}
void cPlayer::SetValue(int SkillOrSpellID, int Value)
{
SkillAndSpellValues[SkillOrSpellID] = Value;
}
int cPlayer::GetValue(int SkillOrSpellID)
{
return SkillAndSpellValues[SkillOrSpellID];
}