Can a class function return an instance of itself. And how to implement it, i.e. eg
function vector.rot(a:single=0):vector; begin a:=a*pi/180; rot:=vector.create(x*cos(a)-y*sin(a),x*sin(a)+y*cos(a)); end;
How to make it so that a new instance of the class is not created with changed parameters relative to the base (input), but instead the parameters of the input instance would change (I know the parameters to change) and it would return as a function.
Self
? In my opinion, it's time to read something about the PLO and many questions will disappear by themselves. - karmadro4Self
, then this book should be in the stove and take another :-) Unfortunately, I can not advise anything, I studied OOP for a very long time. - karmadro4