我有 17 个图块需要根据周围的块更改它们绘制的图像。
http://i.stack.imgur.com/aFsIw.png
我可以这样做,但它非常麻烦且容易出错,我无法让它工作。
if left != mine and right = mine and top = mine and bottom != mine {tile_indexID[ww,hh] = 0;} //
if left = mine and right != mine and top = mine and bottom != mine {tile_indexID[ww,hh] = 1;} //
if left != mine and right = mine and top = !mine and bottom = mine {tile_indexID[ww,hh] = 2;} //
if left != mine and right = mine and top = mine and bottom != mine {tile_indexID[ww,hh] = 3;} //
有没有更好的办法?