public:
int x, y;
int health;
int healthMax;
int strength;
int constitution;
int stamina;
int staminaMax;
int per;
int nCurrentMap;
short colorCode;
std::string charName;
char character;
bool friendly;
int hasSpoken;
int hasSeen[MAP_WIDTH][MAP_HEIGHT*MAPS];
std::pair<int,int> LastSeen;
int cartography;
int staminaAdjust( int );
int healthAdjust( int );
Character();
void setLastSeen();
Character(int, int, int, int, int, int, int, int, short, char *, char, bool);
Character::Character(int, int, int, char*, charType);
friend class boost::serialization::access;
template<typename Archive>
void serialize(Archive& ar,const unsigned version)
{
ar & x & y & health & health & healthMax & strength & constitution & stamina
& staminaMax & per & nCurrentMap & colorCode & charName & character &
friendly & hasSpoken;
}
~Character(void);
};
Character::Character(int xPos, int yPos, int map, char * name, charType type)
{
x = xPos;
y = yPos;
health = type.health;
strength = type.strength;
constitution = type.constitution;
stamina = type.stamina;
per = type.per;
nCurrentMap = map;
colorCode = type.colorCode;
charName = name;
character = type.character;
friendly = type.friendly;
healthMax = constitution * 10;
staminaMax = constitution * 10 + 10;
hasSpoken = 0;
std::memset(hasSeen,0,sizeof(hasSeen));
LastSeen.first=0;
LastSeen.second=0;
cartography =0;
}
but when i compile i get this
error C2665: 'Character::Character' : none of the 4 overloads could convert all the argument types
1> could be 'Character::Character(int,int,int,char *,charType)'
1> while trying to match the argument list '(int, int, int, const char [5], int
Your fourth argument expects a point to modifiable chars but you are passing it a constant char. Your function should probably be taking a const char* as an argument.