0
有人可以幫我弄清楚爲什麼我在下面的LINQ查詢中遇到編譯器錯誤?爲什麼我會得到「表達式表示一個」變量「,這裏有一個」方法組「的預期?
int[,] umap = /* initialize umap */;
int[][] surroundings = new int[][] {
new int[] { x0 - 1, y0 }, new int[] { x0, y0 },
new int[] {x0 + 1, y0}, new int[] { x0 - 1, y0 + 1},
new int[] { x0, y0 + 1 }, new int[] {x0 + 1, y0 + 1},
new int[] { x0 - 1, y0 - 1}, new int[] { x0, y0 - 1 },
new int[] {x0 + 1, y0 - 1}
};
var real = surroundings.Where(pair => pair[0] >= 0 && pair[0] < xN
&& pair[1] >= 0 && pair[1] < yN
&& !umap(pair[0], pair[1]));
這是什麼'umap'這裏是如何定義的 –
我假設'xN'和'yN'是'int's。什麼是'umap'? – smarx
'umap'是一個'bool [,]' – user6048670