Suppose I declare some variables in a class...
Code:
public:
String ^name;
int ilImageName;
int id;
TEX_TYPE type;
TEX_FORMAT format;
I can set these variables in the class and whatnot. However, I can also create property types to set these class varibles, like this:
Code:
protected:
String ^name;
int ilImageName;
int id;
TEX_TYPE type;
TEX_FORMAT format;
public:
property String ^Name{
String ^get() { return(name); }
void set(String ^value) { name = value; }
}
property int ID{
int get() { return(id); }
void set(int value) { id = value; }
}
property TEX_TYPE Type{
TEX_TYPE get() { return(type); }
void set(TEX_TYPE value) { type = value; }
}
property TEX_FORMAT Format{
TEX_FORMAT get() { return(format); }
void set(TEX_FORMAT value) { format = value; }
}
My question here is; is there any real point to using properties? And if not this, what exactly would you use properties for?
Thanks.