Hi, in my code below if I move scope protected below public just as I would like to see it this code won't compile. I always thought that order of members in class is without any importance but here I see something different or I'm doing something wrong? Thank you.
class Object
{
protected:
enum ID {OBJECT, CAVE, MONSTER, WUMPUS, HERO, GUN, BAT};
Coordinates* _my_coordinates;
void id(ID id)
{
this->_my_id = id;
}
public:
explicit Object(s_int coordinate_x = 0, s_int coordinate_y = 0);
virtual void move(Direction, u_int distance = 1) = 0;
Object::ID id() const
{
return _my_id;
}
const Coordinates* location() const
{
return _my_coordinates;
}
virtual ~Object(void);
private:
ID _my_id;
};