visual c++ - setting initial variable for base class from inherited class -
i little rusty c++ , getting bogged down simple question, apologies in advance.
i have created child class existing library class , cannot work out how set initial state 1 of base class functions.
basically have taken sfml circleshape class , added little of own, set origin derived objects fixed number.
the base class takes 'name of class'.setorigin(x,y) straightforward, want know how set standard figure in derived class instances. (basically child class called ball , have class ball ball1, ball2 etc
this may make clear have @ moment:
//derived class-----------------------------------------
class ball : public sf::circleshape { private: int horiz,vert,rate,radius; public:
void sethoriz(int hin) { horiz=hin; } int gethoriz(int hout) { hout=horiz; return(hout); } void setvert(int vin) { vert=vin; } int getvert(int vout) { vout=vert; return(vout); } //----------------------------------------------- void setrate(int in) { rate=in; } int getrate(int out) { out=rate; return(out); } //-----------------------------------------
}; advice on how insert ' circleshape.setorigin ' ball class appreciated. thanks
Comments
Post a Comment