hi guys
could some one explain this code for urgent case.
i'll say what the code does in brief, this code take some values to make a window on the screen which contain a rectangle shape thats all.
there's some difficults in the declaration of the attributes & behaviors of this fragment which i'll indicated by arrow from the left side of the code, here is the code.
class RectangleShape {
public:
// here some obstacles in the constructor delaration
rectangleShape(===>SimpleWindow &window ,float Xcoord ,float Ycoord , ===>const color &Color ,float width , float height);
void Draw();
===>color GetColor() const; //what ment by color here
void GetSize(float &width , float &height)const;
float Getwidth() const;
float GetHeight() const;
void GetPosition(float &Xcoord , float Ycoord);
void SetSize(float Width , float height);
private:
===>SimpleWindow &Window; //what does this mean
float Xcente;
float Ycenter;
===>color Color; //what is the kind of variable Color
float Width;
float Height;
};
#include "rect.h"
SimpleWindow W("Main Window" , 8.0 , 8.0);
int ApiMain()
{
W.Open();
RectangleShape R(W , 4.0 , 4.0 , Blue , 2.0 , 3.0);
R.Draw();
return 0 ;
}