title: Board Game Implementation in Java
body: <p>First of all, I am not sure whether it is allowed to ask this kind of question. So I am trying to create a board game and I was stuck at the implementation of generating valid moves for Piece. Here is the extract of the class diagram.</p>
  
  <p><img src="https://i.stack.imgur.com/MbIsP.jpg" alt="Class Diagram"></p>
  
  <p>You can think this board game like chess, so we need to know the location of other pieces while generating valid moves. The problem is I have no idea how to check it. Is my class diagram wrong? Or should I check at the board every time I check a square? And how do I do that in Java? Thanks for helping.</p>