The Board class has an 8×8 2D-array of Pieces, so I can obviously move a piece with the Board class, by doing board.move(piece1, 3, left) for instance, but there’s no way I could simply tell the piece to move, like piece1.move(3, left), as there’s no way for it to know anything about the board (short of passing it in as a parameter), so it couldn’t move itself to a specific index, or know if a piece already occupies this index, or if it’s being told to move outside of the bounds of the array.
The Board class has an 8×8 2D-array of Piece s, so I can obviously
Share
A piece, by itself, doesn’t know anything about where it happens to be placed (and probably doesn’t need to know). So there’s nothing wrong with needing to call a
Boardmethod to move a piece.