I am getting an error and it happens right at line Chest_vect.push_back(newChest); From my knowledge I don't see anything wrong with it. But I am sure I probably missed something small. If you can help that would be appreciated! Thanks either way!
class Chest_objects {
private:
int loc_x, loc_y;
int map_x, map_y;
string obj_name = "";
string obj_id = "";
bool obj_trigger = false;
bool obj_visible = false;
public:
void setLoc_x(int x)
{
loc_x = x;
}
void setLoc_y(int y)
{
loc_y = y;
}
//OTHER GETTER AND SETTER FUNCTIONS NOT INCLUDED
Chest_objects(int x, int y); //CONSTRUCTOR FUNCTIONS: NOTE I DON'T HAVE A COMPLETE ONE
Chest_objects();
Chest_objects(int x, int y, int my, int mx, string name, string id, bool trig, bool vis);
int getChestVect(vector<Chest_objects>& Chest_vect, const char*getFile)
{
int amount = 0;
int get_x = 0;
int get_y = 0;
int max_x;
int max_y;
char get_info;
ifstream file;
file.open(getFile);
file >> max_x >> max_y;
while(get_info != '0')
{
file >> get_info;
if(get_info == '.')
{
get_x++;
}
if(get_info == 'B')
{
Chest_objects newChest(get_x, get_y);
Chest_vect.push_back(newChest);
get_x++;
amount++;
}
if(get_x >= max_x)
{
get_x = 0;
get_y++;
}
}
return amount;
}
};
int main()
{
... blah
return 0;
}
Chest_objects::Chest_objects(int x, int y)
{
loc_x = x;
loc_y = y;
}
Chest_objects::Chest_objects()
{
loc_x = 0;
loc_y = 0;
}
error: In instantiation of 'void std::vector<_Tp, _Alloc>::_M_insert_aux(std::vector<_Tp, _Alloc>::iterator, const _Tp&) [with _Tp = Chest_objects; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator >; typename std::_Vector_base<_Tp, _Alloc>::pointer = Chest_objects*]':|
error: 'std::ios_base::ios_base(const std::ios_base&)' is private|