I was wondering if it is possible to modify the boolean value returned when checked if an instance of an object is null, for example (I know this is wrong and incomplete, just want to give you a reference):
Main:
SuperObject obj = new SuperObject();
if (obj == null) Console.WriteLine("It is null lol!");
SuperObject:
public bool destroyed = false;
public static bool operator ==(SuperObject A, object B)
{
if (A != null && B == null && destroyed == true)
return true;
}
So if the expression (A == null) is checked and A is NOT null but A.destroyed is TRUE, it will return that (A == null) is TRUE.
Basically I want (A == null) to be TRUE when:
A is really null OR A.destroyed = null; The default value for other comparisons.
I would recommend doing this instead:
Your way would be very confusing to new developers.