#ifndef PLAYER_H
#define PLAYER_H
#include <vector>
class player
{
private:
int health;
int pistolAmmo;
int shotgunAmmo;
int rifleAmmo;
int score;
int money;
vector<string>;
public:
void save();
void load();
void MainGame();
void store();
void inventory();
player();
~player();
void set_health(int H);
void set_pistolAmmo(int PA);
void set_shotgunAmmo(int SA);
void set_rifleAmmo(int RA);
void set_score(int S);
void set_money(int M);
int get_health();
int get_pistolAmmo();
int get_shotgunAmmo();
int get_rifleAmmo();
int get_score();
int get_money();
};
player::player()
{
health = 100;
pistolAmmo = 17;
shotgunAmmo = 8;
rifleAmmo = 30;
score = 0;
money = 0;
}
player::~player()
{
//Empty Deconstructor
}
void player::set_health(int H)
{
health = H;
}
void player::set_pistolAmmo(int PA)
{
pistolAmmo = PA;
}
void player::set_shotgunAmmo(int SA)
{
shotgunAmmo = SA;
}
void player::set_rifleAmmo(int RA)
{
rifleAmmo = RA;
}
void player::set_score(int S)
{
score = S;
}
void player::set_money(int M)
{
money = M;
}
int player::get_health()
{
return health;
}
int player::get_pistolAmmo()
{
return pistolAmmo;
}
int player::get_shotgunAmmo()
{
return shotgunAmmo;
}
int player::get_rifleAmmo()
{
return rifleAmmo;
}
int player::get_score()
{
return score;
}
int player::get_money()
{
return money;
}
#endif // PLAYER_H
errors:
C:\Users\Chay\Desktop\Dinosaur Arena\player.h|15|error: ISO C++ forbids declaration of 'vector' with no type|
C:\Users\Chay\Desktop\Dinosaur Arena\player.h|15|error: expected ';' before '<' token|
||=== Build finished: 2 errors, 0 warnings ===|
C:\Users\Chay\Desktop\Dinosaur Arena\player.h|15|error: ISO C++ forbids declaration of 'vector' with no type|
C:\Users\Chay\Desktop\Dinosaur Arena\player.h|15|error: invalid use of '::'|
C:\Users\Chay\Desktop\Dinosaur Arena\player.h|15|error: expected ';' before '<' token|
||=== Build finished: 3 errors, 0 warnings ===|
I don't know if you really needed std::, but unless you write 'using namespace std;' at the beginning, after the inclusions, you need to explicit your need of the std namespace like that.
In the constructor, you need nothing, it's a class and it gets automatically initialized.
Also, I suggest you to use 'AddToInventory', 'IsInInventory' and 'RemoveFromInventory' instead of SetInventory and GetInventory.