Each item looks like this:
public interface IEffect
{
string Name { get; }
bool Compute ( );
List<IEffect> SubEffects { get; set; }
IEffect ElseIfEffect { get; set; }
}
I want to create a tree-like structure using many instances of these items connected to each other forming a tree-like structure. But later I want to hash each item to a Dictionary, so I thought if I could create a hash value based on where they are on the tree, then I could get unique-enough hash values.
Any ideas on how to do this?
That information is not part of the node but of the tree. So it would be a very bad idea (defining somethings HashCode on external factors).
Luckily, as @spintheblack points out, there is absolutely no reason to override GethashCode() here.