Hello! I have a C # code that RightTriangle:Point class and its derivatives, including the RightTriangle:Point class. I created a link that, under certain conditions, should be equated to different classes (all of them are derived from Point ), and this link should call methods (simple Get / Set) and also make a comparison ( Equals , GetHashCode , == GetHashCode != Redefined for each derived class). The problem is that it trite does not work. The medium writes that there are no methods for the child classes on this link, the comparison, obviously, also fails, yielding false for all cases.
Point obj1; obj1 = rtr1; // rtr1 имеет класс RightTriangle:Point obj1.GetSideA(); // не работает, но у RightTriangle есть метод GetSideA RightTriangle obj2; obj2 = rtr1; obj2.GetSideA(); // теперь работает, но я не знаю класс obj2 заранее upd: read MSDN, did not find anything for my problem. So far, I have implemented the algorithm with the help of a ton of disgusting constructions on if -s, but I really wouldn’t want to leave it that way, because the meaning of the whole OOP in my work is then completely lost.
RightTriangleclassRightTriangle, and the object will not actually be theRightTriangleclass (just thePoint)? - VladD