private int getValueOrMax(Dictionary<Tile, int> dict, Tile key) { if(dict.ContainsKey(key)) return dict[key]; return int.MaxValue; }