I am working on a task but I can not understand this part of it:
Define a delegate bool GreaterOf(Comparable obj1, Comparable obj2) (obj1 is greater than obj2) to compare Comparable objects in terms of SizeOf(); For each of the structs Point, Vector and Triangle define a private method GetSizeOf(Comparable obj1, Comparable obj2) to implement the delegate GreaterOf for the respective struct. Define a property to get the instance of GreaterOf for GetSizeOf().
Here, Comparable is an interface that has that method declaration:
double SizeOf();
I have three structs that implement it(Point, Vector, Triangle). In each of these structs I have defined the method GetSizeOf as follows:
For the Point struct:
private bool GetSizeOf (Point obj1, Point obj2)
{
return obj1.SizeOf() > obj2.SizeOf();
}
What I don't understand is this: Define a property to get the instance of GreaterOf for GetSizeOf().
EDIT: If this would help, further on this is what it is in the condition:
Define a BubbleSort( Comparable[], GreaterOf g) method to sort an array of Comparable objects, where the delegate GreaterOf determines the ordering sequence (Assume the elements of Comparable[] are all Points, Vectors or Triangles only)