Reputation: 63
synchronized void drop(Board board) {
int[][] a = getArray();
int[][] b = board.getArray();
//I don't have currentObject here... what do I need to write?
if (Board.goDown(currentX, currentY, b, a, board, currentObject)) {
currentY++;
updateXY();
}
}
The method call is currentObject.drop(board)
, but we can't pass in currentObject
as a variable.
Is there any easy way of doing this or I just have to rewrite the entire code?
Upvotes: 0
Views: 71
Reputation: 18569
You can use this keyword.
"this" is a reference to the current object.
Upvotes: 2