I have a custom shape class, simplified for the question here, and looks like the following:
class Shape : public SpriteProperties{
};
where class SpriteProperties is:
class SpriteProperties{
Point rotationPivotPoint;
Point rotationPivtoAxes;
float width, height, xPos, yPos, zPos;
Point color;
};
In the user's code, when the user initializes the shape, he uses a function of the following prototype. The params in the function are the required properties for any shape to be represented.
void init(float _x, float _y, float _w, float _h, Point* _color)
{
//Initialize the shape
}
However, my shapes also have additional properties such as rotation pivot points and axes, that the user should specify during this initialization process somehow, and these rotation properties might/might not come to use at a later point for the user depending on how he used the class.
void prepareRotationParams(Point* _rotationPivot, Point* _rotationAxes)
{
//
}
My question:
I am thinking of restricting the user to use this prepare rotation function which might be utilized at a later point in the code, and at the same time I do not want to give the prepare rotation params in the init
function itself, since these do not fall in line with the core properties that must
be explicitly specified by the user for any shape. What would be the ideal approach?