我想使用this website作为帮助,但代码似乎不工作了,所以我正在修复它,现在我得到一个C#标识符预期错误C#XNA标识符预计
public Point PickRandomCellAndMarkItVisited()
{
Random rnd = new Random();
Point randomLocation = new Point(rnd.Next(1, 10), rnd.Next(1, 10));
this.[randomLocation] = true;
return randomLocation;
}
'this。[randomLocation] = true;'是无效的代码。你可能的意思是'this [randomLocation] = true;'请注意,在你连接的代码中,'PickRandomCellAndMarkItVisited'方法在'this'之后没有'.' ... –