public TFunc this[Region from, RegionDirection direction, Region to] { get { TFunc result; if (Functions.TryGetValue(new TransferFunctionKey(from, direction, to), out result)) { return(result); } return(default(TFunc)); } set { var key = new TransferFunctionKey(from, direction, to); if (Functions.ContainsKey(key)) { Functions[key] = value; } else { Functions.Add(new TransferFunctionKey(from, direction, to), value); } } }
public TransferFunctionKey(Region from, RegionDirection direction, Region to) { From = from; To = to; Direction = direction; }