我正在研究代码,但我不明白 for 循环实际上在做什么。
for (final Move move : this.getPossibleMoves(color)) {
// do something..
}
班级搬家:
public class Move {
private final int source;
private final int target;
public Move() {
source = 0;
target = 0;
}
getPossibleMoves 方法:
public Move[] getPossibleMoves(final PieceColor color) {
// do something
return simpleMoves.toArray(new Move[0]);
}